nabilanam/simpleupload 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nabilanam/simpleupload

最新稳定版本:v1.1.5

Composer 安装命令:

composer require nabilanam/simpleupload

包简介

A dead simple laravel file uploader

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License composer.lock available

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

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固