parent
dfe40f760f
commit
5c55628b83
2 changed files with 35 additions and 3 deletions
@ -0,0 +1,33 @@ |
|||||||
|
<?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'), |
||||||
|
]); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue