PHP code example of lexbelcode / laravel-eloquent-dynamic-tables-for-models

1. Go to this page and download the library: Download lexbelcode/laravel-eloquent-dynamic-tables-for-models 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/ */

    

lexbelcode / laravel-eloquent-dynamic-tables-for-models example snippets


$data = Sell::select(...here your columns...)
    ->where(...here your filters...)
    ->with('buyers')
    ->get();

use lexbelcode\LaravelEloquentDynamicTablesForModels\LaravelEloquentDynamicModel;

class Sell extends LaravelEloquentDynamicModel
{
    ...
}

use lexbelcode\LaravelEloquentDynamicTablesForModels\LaravelEloquentDynamicModel;

class Buyer extends LaravelEloquentDynamicModel
{
    ...
}

Sell::$dynamicTableName = 'sells_03';
Buyer::$dynamicTableName = 'buyers_03';

$data = Sell::select(...here your columns...)
    ->where(...here your filters...)
    ->with('buyers')
    ->get();