Download the PHP package hamidrezaniazi/upolo without Composer
On this page you can find all versions of the php package hamidrezaniazi/upolo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hamidrezaniazi/upolo
More information about hamidrezaniazi/upolo
Files in hamidrezaniazi/upolo
Package upolo
Short Description Laravel package for uploading files.
License MIT
Homepage https://github.com/hamidrezaniazi/upolo
Informations about the package upolo
Upolo - Laravel File Uploader
Installation
You can install the package via composer:
You can publish the migration with:
After publishing the migration you can create the files table by running the migrations:
Usage
You can persist uploaded files using the facade:
If you want to add options in your file model during persisting, use this:
Owner is related to your file with a polymorphic relation and should implement from HasFileInterface and use the trait HasFileTrait like this:
Available filter scopes are:
Type is filled automatically based on mime type and includes image, video, application, etc.
Also you can filter files via request in your controller. The keys bellow are available for filtering that you can send via query string:
- owner_id
- owner_type
- creator_id
- type
- flag
For request filtering the index function of your controller should be like this:
Deleting file from storage and database is accessible with delete method:
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Hamidreza Niazi
- All Contributors
License
The MIT License (MIT). Please see License File for more information.