PHP code example of amowogbaje / database-repository

1. Go to this page and download the library: Download amowogbaje/database-repository 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/ */

    

amowogbaje / database-repository example snippets

bash
php artisan data:backup



namespace Database\Seeders;

use Illuminate\Database\Seeder;

use Amowogbaje\DatabaseRepository\DataRepository;

class DatabaseSeeder extends Seeder
{
    public function run()
    {
        $seed = new DataRepository;
        $tableArray = $seed->getAllTablesInADB();
        foreach ($tableArray as $table) {
            $seed->setTableName($table);
            $seed->dataTableSeederFunction();
        }
    }
}

bash
php artisan migrate:fresh --seed