PHP code example of kdabrow / seeder-once

1. Go to this page and download the library: Download kdabrow/seeder-once 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/ */

    

kdabrow / seeder-once example snippets


$app->register(Kdabrow\SeederOnce\Providers\SeederOnceProvider::class);

use Kdabrow\SeederOnce\SeederOnce;

class SomeSeeder extends SeederOnce
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        //
    }
}

use Kdabrow\SeederOnce\SeederOnce;

class DatabaseSeeder extends SeederOnce
{
    public bool $seedOnce = false;
    
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        //
    }
}
 bash
php artisan db:install
shell
php artisan vendor:publish --tag=seederonce.config