Multiples corrections

This commit is contained in:
2026-05-14 18:52:40 +02:00
parent 5b2a2e7ddb
commit 85ad36880c
20 changed files with 7065 additions and 964 deletions
+1
View File
@@ -30,6 +30,7 @@ class UserFactory extends Factory
'email_verified_at' => now(),
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),
'id_role' => \App\Models\Role::first() ?? \App\Models\Role::create(['libelle' => 'Utilisateur']),
];
}
+8 -6
View File
@@ -26,11 +26,13 @@ class DatabaseSeeder extends Seeder
$adminRole = Role::where('libelle', 'Admin')->first();
User::create([
'name' => 'AdminCESI',
'email' => 'admin@cesizen.fr',
'password' => Hash::make('okokokok'), // Toujours hacher !
'id_role' => $adminRole->id,
]);
User::firstOrCreate(
['email' => 'admin@cesizen.fr'],
[
'name' => 'AdminCESI',
'password' => Hash::make('okokokok'),
'id_role' => $adminRole->id,
]
);
}
}