dev-master
9999999-dev
MIT
The Requires
The Development Requires
v0.1
0.1.0.0
MIT
The Requires
The Development Requires
Wallogit.com
2017 © Pedro Peláez
Provide an elegant way to interact with upload & process uploaded file feature., (*1)
Note: The package is only support Laravel 5, (*2)
Step 1: Install package, (*3)
composer require namest/drive
Step 2: Register service provider in your config/app.php, (*4)
return [
...
'providers' => [
...
'Namest\Drive\DriveServiceProvider',
],
...
];
Step 3: Publish package configs. Open your terminal and type:, (*5)
php artisan vendor:publish --provider="Namest\Drive\DriveServiceProvider"
Step 4: Edit your appropriate configurations in config/drive.php:, (*6)
Step 6: Read API below and start happy, (*7)
$file = Drive::accept($input_name);
// Set up validation rules in config file use laravel validation rules
return [
...
'rules' => [
'max:2048', // Kilobytes
// Whatever you want
],
...
];
Throws ValidationException when failed validation., (*8)
$nomal = $file->save();
$large = $file->save('-large'); // With file name suffix
// Recipe: $file-><intervention/image method>($parameters)
$small = $file->crop($width, $height, $x, $y)
->blur($percent)
->save('-small');
drive.profiles config$avatar = $file->profile('avatar')->save();
// For example: apply `avatar` profile with every uploaded images.
// Edit in `drive` config
return [
...
'default_profiles' => [
'image' => ['avatar'],
'video' => [],
],
...
];
MIT
MIT