41 lines
988 B
PHP
41 lines
988 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
use Illuminate\Support\Facades\Hash;
|
|
|
|
class DatabaseSeeder extends Seeder
|
|
{
|
|
use WithoutModelEvents;
|
|
|
|
/**
|
|
* Seed the application's database.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
// Seed default administrator
|
|
User::updateOrCreate(
|
|
['email' => 'admin@company.com'],
|
|
[
|
|
'name' => 'System Administrator',
|
|
'password' => Hash::make('Admin@123'),
|
|
'role' => 'admin',
|
|
]
|
|
);
|
|
|
|
// Seed default standard user (without password since users use Microsoft OAuth)
|
|
User::updateOrCreate(
|
|
['email' => 'user@company.com'],
|
|
[
|
|
'name' => 'John Doe User',
|
|
'role' => 'user',
|
|
'microsoft_id' => 'mock-microsoft-id-123',
|
|
]
|
|
);
|
|
}
|
|
}
|