New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

jaysson/eloquent_filefield

Automatically save files assigned to eloquent model attributes
1,750 4
Install
composer require jaysson/eloquent_filefield
Latest Version:1.0.1
PHP:~5.5|~7.0
Laravel:5
License:MIT
Last Updated:Mar 29, 2020
Links: GitHub  ·  Packagist
Maintainer: jaysson

Eloquent File Field

Easily upload files to a directory and save the filename to database attribute.

It does not handle any image processing. Take a look at [Glide][http://glide.thephpleague.com] for that.

Install

Via Composer

$ composer require jaysson/eloquent_filefield

Usage

In your Eloquent model:

use Jaysson\EloquentFileField\FileFieldTrait;

public $fileFields = [
  'image' => [],
  'poster' => [
  	'disk' => app('config')->get('filesystems.default'),
    'path' => 'uploads/:class_slug/:attribute/:unique_id-:file_name',
    'default_path' => 'uploads/default.png'
  ]
];

Each field can have filesystem disk, path pattern and default path options. If you don't specify any of them, they will be loaded from default config.

Publish default config

$ php artisan vendor:publish 

Security

If you discover any security related issues, please email prabhakarbhat@live.com instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

Related Packages

unisharp/laravel-uploadable

A simple package to attach files to a eloquent model.

3,049 5
czim/laravel-paperclip

Laravel Eloquent file attachment solution

897,266 80
ideil/laravel-generic-file

Easy uploaded files store management for the Laravel.

2,195 0
reich/upload

A great class to upload your file or files to the server, could be integreted wi...

135 10
anourvalar/eloquent-file

Database (Eloquent) layer for files management

4,997 0

Version History

Version Released PHP Laravel License
1.0.1 ~5.5|~7.0 ^5.1 MIT
1.0 ~5.5|~7.0 ^5.1 MIT