{"repo":"qcod/laravel-imageup","free":true,"listed":false,"github":"https://github.com/qcod/laravel-imageup","clone":"git clone https://github.com/qcod/laravel-imageup.git","description":"Auto Image & file upload, resize and crop for Laravel eloquent model using Intervention image","language":"PHP","stars":770,"topics":["laravel","image","upload","image-resize","image-crop","php","eloquent","trait"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Laravel ImageUp The qcod/laravel-imageup is a trait which gives you auto upload, resize and crop for image feature with tons of customization. Installation You can install the package via composer: The package will automatically register itself. In case you need to manually register it you can by adding it in config/app.php providers array: You can optionally publish the config file with: It will create config/imageup.php with all the settings. Getting Started To use this trait you just need to add use HasImageUploads on the Eloquent model and define all the fields which needs to store the images in database. Model Once you marked all the image fields in model it will auto upload the image whenever you save the model by hooking in Model::saved() event. It will also update the database with new stored file path and if finds old image it will be deleted once new image is uploaded. Image field should be as as VARCHAR in database table to store the path of uploaded image. In Controller Make sure to run php artisan storage:link to see the images from public storage disk That's it, with above setup when ever you hit store method with post request and if cover or avatar named file is present on request() it will be auto uploaded. Upload Field options ImageUp gives you tons of customization on how the upload and resize will be handled from defined field options, following are the things you can customize: Customize filename In some case you will need to customize the saved filename. ","default_branch":null,"files":null,"tree":[],"storefront":"/r/qcod","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/qcod/laravel-imageup/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}