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.
You can install the package via composer:
composer require umobi/package-laravel-simple-storage-laravel
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 !!}">
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email freek@umobi.be instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.