umobi / laravel-simple-storage
1.0.1
2020-08-08 00:04 UTC
Requires
- php: ^7.4
- ext-fileinfo: *
- ext-json: *
- illuminate/support: ^5.5|^6.18|^7.0
- league/flysystem: ^1.0.64
Requires (Dev)
- phpunit/phpunit: ^9.0
Suggests
- intervention/image: Required for resize and crop images
- league/flysystem-aws-s3-v3: Required to use AWS S3 file storage
This package is auto-updated.
Last update: 2024-11-08 09:54:09 UTC
README
This package can associate all sorts of files with Eloquent models. It provides a simple API to work with. To learn all about it, head over to the extensive documentation.
Installation
You can install the package via composer:
composer require umobi/package-laravel-simple-storage-laravel
Usage
Here are a few short examples of what you can do:
class User extends Model implements StorageFieldsContract { use StorageFieldsTrait; protected $files = [ 'image' => [ 'path' => 'users', 'type' => 'image', 'extension' => 'jpg', 'default' => 'default.png', 'size' => [300, 300], 'disk' => 'public' ], ]; }
$user = new User(); $user->name = 'Jane Doe'; $user->image = UploadFile|File|Url; $user->save();
<img src="{!! $user->image !!}">
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email freek@umobi.be instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.