You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
760 B
33 lines
760 B
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\Hash;
|
|
use App\Models\User;
|
|
|
|
class UserSeeder extends Seeder
|
|
{
|
|
public function run(): void
|
|
{
|
|
// Tài khoản admin
|
|
User::create([
|
|
'name' => 'Admin',
|
|
'email' => 'admin@admin.com',
|
|
'password' => Hash::make('admin123'),
|
|
]);
|
|
|
|
// 2 tài khoản người dùng
|
|
User::create([
|
|
'name' => 'User One',
|
|
'email' => 'user1@example.com',
|
|
'password' => Hash::make('123123'),
|
|
]);
|
|
|
|
User::create([
|
|
'name' => 'User Two',
|
|
'email' => 'user2@example.com',
|
|
'password' => Hash::make('123123'),
|
|
]);
|
|
}
|
|
}
|
|
|