Seeders need to be registered by adding them to the call function of the DatabaseSeeder.php file... They won't be run automatically if you've just dropped them into the folder:
Or you could use Way's package as it will create the seed file and auto insert that line (register) for you. https://packagist.org/packages/way/generators
php artisan generate:seed users
Yes, I have those files in seed folder and add them into DatabaseSeeder.php file, but it doesn't result anything in database...
May not be the answer, but try check your seeder to see if you have equal columns for every inserts. For instance,
DB::table('users')->insert(array(
array(
'firstname' => 'foo',
'lastname' => 'bar',
),
array(
'firstname' => 'foo2', // lastname field is missing on 2nd array
)
));
The last answer from awsp worked for me! thx!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community