manage images with different entities 2019-07-13 21:47 UTC


Manage images with different entities


  • PHP >=5.4
  • Fileinfo Extension

Supported Image Libraries

  • GD Library (>=2.0)
  • Imagick PHP extension (>=6.5.7)


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
// upload photo

// resize image instance

//get image src

// get image model


in each model add : protected $photoPath="{path}"; ex: protected $photoPath="user";

All images store in :

  • public\images\$photoPath
  • please create a correct folder path