Download the PHP package andach/laravel-attachments-comments without Composer
On this page you can find all versions of the php package andach/laravel-attachments-comments. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download andach/laravel-attachments-comments
More information about andach/laravel-attachments-comments
Files in andach/laravel-attachments-comments
Package laravel-attachments-comments
Short Description This is a Laravel package to allow you to add comments and attachments to models.
License MIT
Homepage https://github.com/andach-limited/laravel-attachments-comments
Informations about the package laravel-attachments-comments
Laravel Attachments and Comments by Andach
This is a Laravel package for adding Attachments and Comments to any model.
Installation
You can install the package via composer:
You should then publish the config and migrations with:
Usage
Using a Trait
To add the relations to a model, simply add the MorphToAttachmentsAndComments
trait to the model. If only one is needed, then just use MorphToAttachments
or MorphToComments
by themselves.
Adding Attachments and/or Comments
To actually add an attachment or a comment, you can use the addAttachmentAndComment()
. This accepts a single string and an optional UploadedFile.
And in the relevant controller method...
If handed an empty string or null attachment, the system will not create an attachment or comment silently.
Retrieving Attachments and Comments
The relations are all handled by the traits, so you can just call:
Displaying Comments and Attachments
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-attachments-comments with dependencies
andach/laravel-primary-key-uuid Version ^1.0
illuminate/contracts Version ^10.0
spatie/laravel-package-tools Version ^1.14.0