PHP code example of nomanurrahman / fresh-seed

1. Go to this page and download the library: Download nomanurrahman/fresh-seed 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/ */

    

nomanurrahman / fresh-seed example snippets


return [
    /*
     * Define presets or groups of tables that can be refreshed together.
     * Groups can be an array of table names (auto-guesses seeders) or key-value pairs of table => seeder.
     */
    'groups' => [
        'auth' => [
            'users' => 'Database\\Seeders\\UserSeeder',
            'roles' => 'Database\\Seeders\\RoleSeeder',
            'permissions' => 'Database\\Seeders\\PermissionSeeder',
        ],
        'shop' => ['products', 'categories', 'orders'],
    ],

    /*
     * Default connection to use if not specified in command.
     */
    'connection' => null,
];
bash
php artisan vendor:publish --provider="Nomanurrahman\FreshSeed\FreshSeedServiceProvider" --tag="config"
bash
php artisan fresh:seed
bash
php artisan fresh:seed --table=users
bash
php artisan fresh:seed --table=users,posts,comments
bash
php artisan fresh:seed --group=auth
bash
php artisan fresh:seed --table=users --seeder=CustomUserSeeder
bash
php artisan fresh:seed --table=posts --safe
bash
php artisan fresh:seed --group=auth --dry-run
bash
php artisan fresh:seed --table=users --database=tenant_1