承接 codefun/filemanager 相关项目开发

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

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

codefun/filemanager

最新稳定版本:v1.0.2

Composer 安装命令:

composer require codefun/filemanager

包简介

Laravel File Manager For Main All Types of file upload

README 文档

README

  • This package will automatically handel your all files for upload, update & delete.

Installation Process

  • composer require codefun/filemanager
  • php artisan vendor:publish --tag=codefun_fileManager_migration
  • php artisan migrate

Before Laravel 5.7

Add the following into your providers array on config\app.php:

  • CodeFun\Activitylog\App\Providers\FileManagerServiceProvider

then add This alias into alias array on config\app.php:

  • "FileManager" => CodeFun\Activitylog\Facade\FileManager::class

Not necessary from Laravel 5.7 onwards

How To Upload File?

In your method Just Use it Available methods

$user = User::find($id);
FileManager::model($user)->upload($fileName, $width = null, $height =  null);
FileManager::coverPic()->upload($fileName, $width = null, $height =  null);
FileManager::profilePic()->upload($fileName, $width = null, $height =  null);
FileManager::deleteAll(Model $model);
FileManager::model($user)->delete(array | string $deleteAbleFileId);
FileManager::model($user)->update(array | string $updateAbleFileId)->upload($fileName, $width = null, $height =  null);

Go to your Model and use the trait file:

use CodeFun\FileManager\App\Component\Traits\FileManager;
class AnyModel extends Model
{
    use FileManager;
}

Retrive Multiple Uploaded Files without cover & profice pic

$user = User::find(1);
$user->files() [ This Method Return File List(Array List)]

Retrive All Uploaded Files

$user = User::find(1);
$user->allFiles() [ This Method Return File List(Array List)]

Retrive profile Pic

$user = User::find(1);
$user->profilePic() [ This Method Return single File ]

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-16