Laravel seed procedure

Explains easy way to seed your database

In database/factories open ModelFactory.php and change model you wish to populate. In my app i want to populate Todos model:

$factory->define(App\Todos::class, function (Faker\Generator $faker) { return [ 'todo' => $faker->paragraph(), 'completed' => $faker->boolean(50), ]; });

Next open terminal and type:

php artisan tinker

This will insert eleven records into database. Type:

factory(App\Todos::class, 11)->create();