Download the PHP package mar3y/image-upload without Composer
On this page you can find all versions of the php package mar3y/image-upload. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mar3y/image-upload
More information about mar3y/image-upload
Files in mar3y/image-upload
Package image-upload
Short Description A package for handling image uploads in Laravel applications.
License MIT
Informations about the package image-upload
Image Upload Package
A Laravel package for handling image uploads in your applications.
Compatibility
This package supports Laravel 8 through Laravel 13.
Installation
You can install the package via composer:
Usage
Using the HasImage Trait
To use the HasImage trait in your model, follow these steps:
-
Add the trait to your model class:
-
Define the image attributes:
In your model class, define the
$imageAttributesproperty as an array of attribute names that will store image paths. For example, if your model has animageattribute, you would setprotected static $imageAttributes = ['image'];. -
Upload an image:
When you save a model instance with an image attribute set to an
UploadedFileinstance, the trait will automatically upload the image and store the path in the attribute. -
Retrieve the image URL:
You can retrieve the full URL of the image using the attribute name.
Using the ImageUploadHelper
You can also use the ImageUploadHelper class directly:
License
The MIT License (MIT). Please see License File for more information.
All versions of image-upload with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/filesystem Version ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0