mintellity/upload-document
最新稳定版本:1.2.0
Composer 安装命令:
composer require mintellity/upload-document
包简介
Upload documents for Laravel.
README 文档
README
This is a package for Laravel to easy upload documents to any model.
Installation
You can install the package via composer:
composer require mintellity/upload-document
You can publish the asset, config and migration files:
php artisan upload-document:install
Optional you can publish the view files:
php artisan vendor:publish --tag="upload-document-views"
Usage
Add the trait to any model you want to has documents.
use Mintellity\UploadDocument\Traits\InteractsWithDocuments;
Optional you can edit the config file. The User array is used for different document types.
return [ 'routes' => [ 'middleware' => [ 'web' ] ], App\Models\User::class => [ 'first' => 'First', 'second' => 'Second', 'third' => 'Third', ] ];
Add the component form in some view to upload documents.
<x-upload-document-upload-form/>
There are many variables with which you can configure the component.
model - A model linked to documents. model-label - A label for the models. Default value is 'Modelltyp'. selected-model - If the specific model is already chosen. collection-label - A label for the document types. Default value is 'Dateityp'. allowedMimeTypes - An array of allowed document types. Default value is '.pdf', multiple - Boolean value for allowing the users to upload multiple files. Default value is 'false'.
Add the component table in some view to show documents.
<x-document-table-document-table/>
There are also variables with which you can configure the component.
documents - A collection from documents. selected-model - If the specific model is already chosen. edit - Boolean value for allowing the users to update or delete the documents. Default value is 'true'.
Examples.
<x-document-table-document-table :model="User::class" :model-label="'Choose from the list'" :multiple="true"/> <x-document-table-document-table :selected-model="User::first()" :collection-label="'Choose from the list'"/> <x-document-table-document-table :documents="auth()->user()->getDocuments()"/> <x-document-table-document-table :selected-model="User::first()" :edit="false"/>
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 152
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-11