Skip to content

umobi/laravel-simple-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest Version on Packagist GitHub Tests Action Status Total Downloads

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.

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages