承接 ikepu-tp/laravel-file-library 相关项目开发

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

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

ikepu-tp/laravel-file-library

最新稳定版本:v1.3.0

Composer 安装命令:

composer require ikepu-tp/laravel-file-library

包简介

关键字:

README 文档

README

This is a file management library for Laravel.

How to use

Install

composer require ikepu-tp/larave-file-library

Publish configuration etc

php artisan vendor:publish --provider="ikepu_tp\FileLibrary\FileLibraryServiceProvider"

Routing

HTTP Method URI Action Route Name Description
GET /file/lib index file-library.index Display a list of files in the file library.
GET /file/lib/create create file-library.create Display a form for uploading a new file.
POST /file/lib store file-library.store Upload a file.
GET /file/lib/{fileId} show file-library.show Display details of a specific file.
GET /file/lib/{fileId}/edit edit file-library.edit Display a form for editing a specific file.
PUT /file/lib/{fileId} update file-library.update Update a specific file.
DELETE /file/lib/{fileId} destroy file-library.destroy Delete a specific file.

Note

{fileId} means uuid.

Upload File

Default Route
POST http://your-project.com/file/lib
Key Type Accepted Values Required
files Array<int, File> Y
names Array<int, string> max length: 250 Y
Original Route
class FileController extends Controller
{
    public function store(Request $request)
    {
        $guard = config("file-library.guard");
        $files = \ikepu_tp\FileLibrary\app\Services\FileLibraryService::upload(
            $guard, 
            $request->file("files", []), 
            $request->input("names", [])
        );

        return back()->with("status", "File uploaded.");
    }
}

Edit File

PUT http://your-project.com/file/lib/{fileId}
Key Type Accepted Values Required
name string max length: 250 Y

API Documentation

FileLibraryController

FileLibraryResource

{
  "fileId": "string",
  "name": "string",
  "url": "string",
  "mime_type": "string",
  "created_at": "string",
  "updated_at": "string"
}

index

Display a list of files in the file library.

GET http://your-project.com/file/lib
index Sample
{
    "status":{
        "result":true,
        "code":200,
    },
    "payloads":{
        "meta": {
            "currentPage": 1,
            "lastPage": 1,
            "length": 1,
            "getLength": 0,
            "per":1,
        },
        "items":[
                {
                    "fileId": "uuid",
                    "name": "file name",
                    "url": "http://your-project.com/file/lib/uuid",
                    "mime_type": "application/json",
                    "created_at": "2024-01-01T00:00:00Z",
                    "updated_at": "2024-01-01T00:00:00Z"
                }
        ]
    }
}

store

Upload a file.

POST http://your-project.com/file/lib
store Sample
{
    "files": [
        "FILE BINARY",
    ],
    "names":[
        "file name",
    ]
}
{
    "status":{
        "result":true,
        "code":201,
    },
    "payloads": [
        {
            "fileId": "uuid",
            "name": "file name",
            "url": "http://your-project.com/file/lib/uuid",
            "mime_type": "application/json",
            "created_at": "2024-01-01T00:00:00Z",
            "updated_at": "2024-01-01T00:00:00Z"
        }
    ]
}

show

Display details of a specific file.

GET http://your-project.com/file/lib/{fileId}

update

Update a specific file.

PUT http://your-project.com/file/lib/{fileId}

destroy

Delete a specific file.

DELETE http://your-project.com/file/lib/{fileId}

Contributing

We welcome contributions to the project! You can get involved through the following ways:

Issue: Use for bug reports, feature suggestions, and more.

Pull Requests: We encourage code contributions for new features and bug fixes.

License

See LICENSE.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固