1. Go to this page and download the library: Download akunbeben/eloquent-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/ */
akunbeben / eloquent-file example snippets
use EloquentFile\EloquentFile\Facades\EloquentFile;
EloquentFile::open(storage_path('backups/backup.sql'));
$activeUsers = EloquentFile::table('users')
->where('status', 'Active')
->orderBy('name')
->get();
use Illuminate\Database\Eloquent\Model;
class ArchivedUser extends Model
{
protected $connection = 'eloquent-file';
protected $table = 'users';
}
EloquentFile::open(storage_path('backups/backup.sql'));
$user = ArchivedUser::find(1);