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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor