Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Attachment Library Laravel Package

van-ons/laravel-attachment-library

Attach files to Laravel Eloquent models with a simple HasAttachments trait and Attachment model. Includes installer command for migrations/assets and an attachments relationship to link existing uploads to any model.

View on GitHub
Deep Wiki
Context7

Responsive images

This package includes a Blade component for loading responsive images that scale depending on breakpoints. This ensures optimal performance by delivering appropriately sized images for different screen sizes.

Usage

To use the responsive image component, simply include it in your Blade template as follows:

<x-laravel-attachment-library-image :src="$image" />

Parameters

  • src: The source of the image. This can be a file path string, an Attachment object, or a numeric ID.
  • size: The size ratio of the image. Available sizes are defined in the glide.php config file.
  • aspectRatio: The aspect ratio of the image.
  • class: Additional CSS-classes.

Manually resize image

The Resizer class is responsible for resizing images. It is also possible to call this class directly from other places in the application.

The Resizer class returns an array with width, height and url. The URL should be used as source for the image element. An example code snippet could be:

\VanOns\LaravelAttachmentLibrary\Facades\Resizer::src($image)
    ->height(200)
    ->width(500)
    ->resize();

/**
 * Valid source:
 * [
 *   'width' => 500,
 *   'height' => 200,
 *   'url' => 'http://test.local/img/path-to-image.jpg?w=500&h=200&signature=....'
 * ]
 * 
 * Invalid source:
 * []
 */
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours