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

Manage attachments and directories

The AttachmentManager facade is the main part of this package. This class is responsible for uploading, deleting, modifying and moving files while making sure that the database representation stays in sync.

Attachments

The AttachmentManager offers many ways to manage attachments.

Upload a new attachment

$attachmentModel = \VanOns\LaravelAttachmentLibrary\Facades\AttachmentManager::upload($attachment);

Move an attachment to another directory

$attachmentModel = \VanOns\LaravelAttachmentLibrary\Facades\AttachmentManager::move($attachment, 'new/path');

Rename an attachment

$attachmentModel = \VanOns\LaravelAttachmentLibrary\Facades\AttachmentManager::rename($attachment, 'newName');

Delete an attachment

$attachmentModel = \VanOns\LaravelAttachmentLibrary\Facades\AttachmentManager::delete($attachment);

Directories

The AttachmentManager also offers ways to manage directories.

Create a new directory

$attachmentModel = \VanOns\LaravelAttachmentLibrary\Facades\AttachmentManager::createDirectory('path/directory-name');

Rename an existing directory

$attachmentModel = \VanOns\LaravelAttachmentLibrary\Facades\AttachmentManager::renameDirectory('path/directory-name', 'new-name');

Delete a directory

[!WARNING] This will also remove any files and subdirectories in the directory. Make sure the directory is empty if you don't want to remove any files.

$attachmentModel = \VanOns\LaravelAttachmentLibrary\Facades\AttachmentManager::deleteDirectory('path/directory-name');
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.
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
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