- Delete old Vite+Svelte frontend - Initialize new SvelteKit project with TypeScript - Configure Tailwind CSS v4 + DaisyUI - Implement JWT authentication with auto-refresh - Create login page with form validation (Zod) - Add protected route guards - Update Docker configuration for single-stage build - Add E2E tests with Playwright (6/11 passing) - Fix Svelte 5 reactivity with $state() runes Known issues: - 5 E2E tests failing (timing/async issues) - Token refresh implementation needs debugging - Validation error display timing
66 lines
1.8 KiB
PHP
66 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\Hash;
|
|
use Illuminate\Support\Str;
|
|
|
|
class UserSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
// Create superuser for testing
|
|
DB::table('users')->updateOrInsert(
|
|
['email' => 'superuser@headroom.test'],
|
|
[
|
|
'id' => (string) Str::uuid(),
|
|
'name' => 'Super User',
|
|
'email' => 'superuser@headroom.test',
|
|
'password' => Hash::make('password'),
|
|
'role' => 'superuser',
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
]
|
|
);
|
|
|
|
// Create test users for each role
|
|
$testUsers = [
|
|
[
|
|
'name' => 'Manager User',
|
|
'email' => 'manager@headroom.test',
|
|
'role' => 'manager',
|
|
],
|
|
[
|
|
'name' => 'Developer User',
|
|
'email' => 'developer@headroom.test',
|
|
'role' => 'developer',
|
|
],
|
|
[
|
|
'name' => 'Top Brass User',
|
|
'email' => 'topbrass@headroom.test',
|
|
'role' => 'top_brass',
|
|
],
|
|
];
|
|
|
|
foreach ($testUsers as $user) {
|
|
DB::table('users')->updateOrInsert(
|
|
['email' => $user['email']],
|
|
[
|
|
'id' => (string) Str::uuid(),
|
|
'name' => $user['name'],
|
|
'email' => $user['email'],
|
|
'password' => Hash::make('password'),
|
|
'role' => $user['role'],
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
]
|
|
);
|
|
}
|
|
}
|
|
}
|