nour / images
manage images with different entities
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/nour/images
Requires
- intervention/image: 2.4
This package is auto-updated.
Last update: 2025-12-14 13:46:15 UTC
README
Manage images with different entities
Requirements
- PHP >=5.4
- Fileinfo Extension
Supported Image Libraries
- GD Library (>=2.0)
- Imagick PHP extension (>=6.5.7)
Installation
composer require nour/images
After you have installed Intervention Image, open your Laravel config file config/app.php and add the following lines.
In the $providers array add the service providers for this package.
Nour\Images\Providers\ImagesServiceProvider::class,
add Imageable in each model you want use image manager with it.
- ex:
use Notifiable,Imageable;
php artisan migrate
Code Examples
// get user $user=Auth::user(); // upload photo $user->photo($request->file('photo'))->upload(); // resize image instance $user->photo($request->file('photo'))->width(756)->height(425)->upload(); //get image src $user->getImage() // get image model $user->Image;
Storage
in each model add :
protected $photoPath="{path}";
ex:
protected $photoPath="user";
All images store in :
public\images\$photoPath- please create a correct folder path