PHP code example of singlequote / laravel-model-seeder

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

    

singlequote / laravel-model-seeder example snippets




return [
    
    /**
     * The relative path from your root to your models location
     * You can add multiple model paths
     */
    'models_path' => [
        "app/Models"
    ],
    
    /**
     * The relative path from your root to the location where the seeders will be generated
     */
    'output_path' => "database/seeders",
    
    /**
     * These columns will be excluded from your seeders
     */
    'exclude_columns' => [
        "id",
    ],    
];
bahs
php artisan seed:make
bash
php artisan vendor:publish --tag=model-seeder
bash
php artisan seed:make --path=Modules/TestModule/App/Models
bash
php artisan seed:make --path=Modules/TestModule/App/Models --output=database/seeders
bash
php artisan seed:make --path=auto
bash
php artisan seed:make --only=User,Roles
bash
php artisan seed:make --orderBy=created_at
bash
php artisan seed:make --orderByDesc=created_at