- Execute the following command to create UsersTableSeeder.php file.
php artisan make:seeder UsersTableSeeder - Then open UsersTableSeeder.php file and update it with the user login details.
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use DB;
class UsersTablesSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table(‘users’)->insert([
‘name’ => ‘admin’,
’email’ => ‘admin@email.com’,
‘password’ => bcrypt(‘Admin@123’)
]);
}
}
?> - Execute the following command to execute the seed file and create users to the database.
php artisan db:seed –class=”UsersTablesSeeder“
If you have any doubts comment here.