PHP code example of zotyo / u-filer

1. Go to this page and download the library: Download zotyo/u-filer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zotyo / u-filer example snippets




namespace App;

use Illuminate\Foundation\Auth\User as Authenticatable;
use Zotyo\uFiler\HasFile;

class User extends Authenticatable
{

    use HasFile;
    protected $fillable = ['avatar'];
    protected $appends  = ['avatar'];

    public function getAvatarAttribute()
    {
        return $this->getFile('avatar');
    }

    public function setAvatarAttribute($value)
    {
        $this->setFile('avatar', $value);
    }
}



namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UserFormRequest extends FormRequest
{
    public function rules()
    {
        return [
            'avatar' => '

php artisan vendor:publish --provider="Zotyo\uFiler\PackageServiceProvider"