package for ImageManager
Image manger to mange upload and select image with one line of code, (*1)
composer require elsayednofal/imagemanager:3.0
Elsayednofal\Imagemanager\ImageManagerServiceProvider::class
'ImageManager' => Elsayednofal\Imagemanager\Controllers\MediaController::class,
php artisan vendor:publish
php artisan migrate
1- add {!! ImageManager::loadAssets() !!}
befor , (*2)
close
2- add {!! ImageManager::loadModal() !!}
after , (*3)
one single line in your blade where you want uploader in your form :, (*4)
//images[] is the variable you will recieve the ids of selected or uploaded images in {!! ImageManager::selector('images[]') !!}
some cases like update you want to show old selected images so you can pass the ids as second prameter like :, (*5)
//images[] is the variable you will recieve the ids of selected or uploaded images in {!! ImageManager::selector('images[]',[10,15,17])?>
//images[] is the variable you will recieve the ids of selected or uploaded images in // [] represent selected ids // false => means only one image can be set {!! ImageManager::selector('images[]',[],false)?>
How to get the value of selected or uploaded image ? The ImageManger::selector() inject input hidden with value of ids of selcted images, (*6)
Retrive Image (display image ), (*7)
ImageManager::getImagePath($id,$size='') id image id size can be '' for orginal size , 'thumb' for thumbnial and 'small' for small image <img src="{{ImageManager::getImagePath($activity->mainImage->image_id,'small')}}" />
one file upload
{!! ImageManager::ImageUploader(['name'=>'logo'])!!}
, (*8)
upload and update old
{!! ImageManager::ImageUploader(['name'=>'logo','image'=>$logo])!!}
, (*9)
upload file musr have width and hight
{!! ImageManager::ImageUploader(['name'=>'logo','image'=>$logo,'width'=>160,'height'=>160])!!}
, (*10)
For any questions contact me at : elsayed_nofal@ymail.com
, (*11)