nabilanam/simpleupload
最新稳定版本:v1.1.5
Composer 安装命令:
composer require nabilanam/simpleupload
包简介
A dead simple laravel file uploader
README 文档
README
Dead simple Laravel file uploader.
Installation
Via Composer:
$ composer require nabilanam/simpleupload
You can publish the config file:
php artisan vendor:publish --provider="NabilAnam\SimpleUpload\SimpleUploadServiceProvider"
Usage
// somewhere in your controller use NabilAnam\SimpleUpload\SimpleUpload; public function update(Request $request, YourModel $model) { $model->image = (new SimpleUpload) ->file($request->image) // store normal request file ->fileBase64($request->image) // store file from base64 image data uri ->dirName('images') // directory to store the file into ->resizeImage(600, 100) // resize with intervention ->keepAspectRatio() // best fit aspect ratio by intervention ->intervention(function ($image) { // need more? return $image; }) ->skipDay() // removes day directory from path ->skipMonth() // removes month directory from path ->skipYear() // removes year directory from path ->skipDirectory() // removes day, month, year directory from path ->deleteIfExists($model->image) // deletes file with given path ->save(); // processs && return final file path $model->save(); return back(); } // somewhere in your blade file <img src="{{ asset($model->image) }}" alt="image">
Change log
Please see the changelog for more information on what has changed recently.
Contributing
Pull requests are welcome!
Security
If you discover any security related issues, please email nabil_code@outlook.com instead of using the issue tracker.
Credits
License
MIT. Please see the license file for more information.
统计信息
- 总下载量: 964
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-21