udhuong / laravel-upload-file
Package for upload file
Requires
- php: >=7.4.0
- ext-fileinfo: *
- guzzlehttp/guzzle: ^7.4.1
- illuminate/filesystem: ^8.83|^9.0
- illuminate/support: ^8.83|^9.0
- intervention/image: ^2.7.1
- league/flysystem: ^3.0.4
- league/flysystem-aws-s3-v3: ^3.0
- psr/http-message: ^1.0.1
- symfony/http-foundation: ^5.0.11|^6.0.3
Requires (Dev)
- aws/aws-sdk-php: ^3.166.2
- doctrine/dbal: ^2.11|^3.0
- guzzlehttp/promises: ^1.5.1
- laravel/legacy-factories: ^1.3.0
- mockery/mockery: ^1.4.2
- orchestra/testbench: ^7.6
- php-coveralls/php-coveralls: ^2.5.2
- phpunit/phpunit: ^9.5.13
- vlucas/phpdotenv: ^4.2.2|^5.4.1
This package is auto-updated.
Last update: 2024-04-13 13:25:46 UTC
README
Laravel-Upload-File is a package for uploading files with Laravel.
Features
- Filesystem-driven approach is easily configurable to allow any number of upload directories with different accessibility. Easily restrict uploads by MIME type, extension and/or aggregate type (e.g.
image
for JPEG, PNG or GIF).
Example Usage
Upload a file to the server, and place it in a directory on the filesystem disk named "uploads". This will create a Media record that can be used to refer to the file.
$file = LaravelUploadFile::fromSource($request->file('images')) ->toDestination('s3', 'uploads') ->upload();
Installation
Add the package to your Laravel app using composer
composer require udhuong/laravel-upload-file
Register the package's service provider in config/app.php
. In Laravel versions 5.5 and beyond, this step can be skipped if package auto-discovery is enabled.
'providers' => [ ... Udhuong\LaravelUploadFile\UploadFileServiceProvider::class, ... ];
The package comes with a Facade for the image uploader, which you can optionally register as well. In Laravel versions 5.5 and beyond, this step can be skipped if package auto-discovery is enabled.
'aliases' => [ ... 'FileUploader' => Plank\Mediable\FileUploader::class, ... ]
Publish the config file (config/mediable.php
) of the package using artisan.
php artisan vendor:publish --provider="Udhuong\LaravelUploadFile\UploadFileServiceProvider"
Documentation
Updating...
License
This package is released under the MIT license (MIT).
About package
Package developed based on laravel-mediable of plank/laravel-mediable
About author
Plank is a web development agency based in Hanoi, Vietnam.