A package for convenient way to upload files to the different storages
- Run the command below to add this package:
composer require xpert/upload
- Open your
config/app.php
and add the following to the providers array:
Xpert\upload\UploadServiceProvider::class
- Open your
config/app.php
and add the following to the aliases array:
'FileUpload' => Xpert\upload\Facade\FileuploadFacade::class
- Run the command below to publish the package:
php artisan vendor:publish
use FileUpload;
public function upload(Request $request)
{
// This will upload your file to the upload package composer
FileUpload::upload($request,'uploads/images','img');
}
A package for convenient way to upload files to Resize original file and thumbnail
- Run the command below to add this package:
composer require intervention/image
- Open your
config/app.php
and add the following to the providers array:
Intervention\Image\ImageServiceProvider::class
- Open your
config/app.php
and add the following to the aliases array:
'ImageResize' => Intervention\Image\Facades\Image::class
- Run the command below to publish the package:
php artisan vendor:publish
use FileUpload;
public function uploadWithResize(Request $request)
{
// This will upload your file to the resize upload.
FileUpload::uploadResize($request,'uploads/original','uploads/thumbnail','image');
}