feat: Reinitialize frontend with SvelteKit and TypeScript
- 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
This commit is contained in:
65
backend/database/seeders/UserSeeder.php
Normal file
65
backend/database/seeders/UserSeeder.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?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(),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user