PHP code example of ranium / laravel-seedonce

1. Go to this page and download the library: Download ranium/laravel-seedonce 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/ */

    

ranium / laravel-seedonce example snippets


php artisan vendor:publish --tag=laravel-seedonce-config

php artisan migrate


File: database/seeds/DatabaseSeeder.php

use Illuminate\Database\Seeder;
use Ranium\SeedOnce\Traits\SeedOnce;

class DatabaseSeeder extends Seeder
{
    use SeedOnce;

    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        $this->call(UsersTableSeeder::class);
        $this->call(RolesTableSeeder::class);
    }
}

php artisan seedonce:mark-seeded

php artisan seedonce:mark-seeded --class=UsersTableSeeder

php artisan seedonce:status