Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

parameter to laravel seeder

class UsersTableSeeder extends Seeder
{
    public function run()
    {
        $limit = env('SEEDER_LIMIT', 1);

        echo $this->limit;
    }
}

//In terminal run:
SEEDER_LIMIT=10 php artisan db:seed --class=UsersTableSeeder
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #parameter #laravel #seeder
ADD COMMENT
Topic
Name
2+6 =