PHP code example of codepluswander / laravel-database-seed-version

1. Go to this page and download the library: Download codepluswander/laravel-database-seed-version 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/ */

    

codepluswander / laravel-database-seed-version example snippets




return [
    'seeders' => [
        \MyNameSpace\MySeeder::class
    ],
];



namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Codepluswander\LaravelDatabaseSeedVersion\DatabaseSeederVersion;
use Database\Seeders\TestSeeder;

class AppServiceProvider extends ServiceProvider
{
    public function register()
    {
        $this->app->afterResolving(DatabaseSeederVersion::class, function ($service) {
            $service->addSeeder([TestSeeder::class]);
        });
    }
}
shell
php artisan migrate
shell
php artisan vendor:publish --provider="Codepluswander\LaravelDatabaseSeedVersion\DatabaseSeedVersionServiceProvider"