PHP code example of falbar / laravel-system-file

1. Go to this page and download the library: Download falbar/laravel-system-file 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/ */

    

falbar / laravel-system-file example snippets


use Akbsit\SystemFile\Traits\InteractsMedia;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    use InteractsMedia;
}

User::first()
    ->addMedia('<file_url>')
    ->setFileName('user1')
    ->put();

User::first()
    ->addMedia('<file_url>')
    ->setFileName('user1')
    ->single()
    ->put();

$oSystemFile = User::first()->getMediaFirst();

$oSystemFileList = User::first()->getMedia();
bash
php artisan migrate
bash
php artisan system-file:sync