承接 plusemon/uploader 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

plusemon/uploader

Composer 安装命令:

composer require plusemon/uploader

包简介

Laravel model file upload helper package.

README 文档

README

Easy way to upload laravel model related file from the requset.

Basic Examples

$product = Product::first();

// Store file
$product->uploadRequestFile('image'); // attach $request->image into $product->image
$product->uploadRequestFile('image', 'thumbnail'); // attach $request->image into $product->thumbnail
$product->uploadRequestFile('image')->saveInto('thumbnail'); // save into custom column

// Update file
$product->uploadRequestFile('image')->updateInto('thumbnail'); // will delete old file and update the new file

// Delete file
$product->deleteFile('image');
$product->deleteWithFile('image'); // delete the model with file
$product->deleteWith('image'); // deleteWithFile() shorter

// Upload multiple files
$product->uploadRequestFiles('images')->getUploadedFiles(); // return the uploaded files as array
$product->uploadRequestFiles('images')->saveInto('thumbnails', true); // save as array into $product->thumbnails
$product->uploadRequestFiles('images')->saveAsArrayInto('thumbnails'); 

# Note: all the files will be save into /public/uploads/products/images/products-1.jpg


// Get the attached file url 
$product->urlOf('image') // https://website.com/uploads/products/images/products-1.jpg

// Render the file
//  <img src="{{ $product->urlOf('image') ?? 'no-image-available.png' ">


## Advance

// Intervention Image support
$product->uploadRequestFile('image')->image()->resize()->crop()->save();  

// custom file upload helper
$product->upload($request->file('image'), $module_name = 'products', $file_type = 'images', $unique_id = 123);

Installation

composer require plusemon/uploader

use HasUploader trait on the dedicated model

<?php

namespace App\Models;
use Plusemon\Uploader\HasUploader;
use Illuminate\Database\Eloquent\Model;

class Product extends Model
{
    use HasUploader;
}

You are ready to go... :)

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.

plusemon/uploader 适用场景与选型建议

plusemon/uploader 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 288 次下载、GitHub Stars 达 5, 最近一次更新时间为 2022 年 06 月 01 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 plusemon/uploader 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 plusemon/uploader 我们能提供哪些服务?
定制开发 / 二次开发

基于 plusemon/uploader 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 288
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-01