38 lines
890 B
PHP
38 lines
890 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\Hash;
|
|
|
|
class DatabaseSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Seed the application's database.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
User::create([
|
|
'name' => "admin",
|
|
'email' => "admin@admin",
|
|
'password' => Hash::make("admin"),
|
|
'role' => "admin"
|
|
]);
|
|
User::create([
|
|
'name' => "Bob teacher",
|
|
'email' => "bob@teacher",
|
|
'password' => Hash::make("bob"),
|
|
'role' => "teacher"
|
|
]);
|
|
User::create([
|
|
'name' => "Alice student",
|
|
'email' => "alice@student",
|
|
'password' => Hash::make("alice"),
|
|
'role' => "student"
|
|
]);
|
|
}
|
|
}
|