Refactor database seeder to use config for admin credentials and add admin configuration file
This commit is contained in:
7
config/admin.php
Normal file
7
config/admin.php
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'name' => env('ADMIN_NAME', 'Admin'),
|
||||||
|
'email' => env('ADMIN_EMAIL', 'admin@example.com'),
|
||||||
|
'password' => env('ADMIN_PASSWORD', 'changeme123'),
|
||||||
|
];
|
||||||
@@ -16,14 +16,15 @@ class DatabaseSeeder extends Seeder
|
|||||||
// User::factory(10)->create();
|
// User::factory(10)->create();
|
||||||
|
|
||||||
User::updateOrCreate(
|
User::updateOrCreate(
|
||||||
['email' => env('ADMIN_EMAIL')],
|
['email' => config('admin.email')],
|
||||||
[
|
[
|
||||||
'name' => env('ADMIN_NAME'),
|
'name' => config('admin.name'),
|
||||||
'email' => env('ADMIN_EMAIL'),
|
'email' => config('admin.email'),
|
||||||
'password' => Hash::make(env('ADMIN_PASSWORD')),
|
'password' => Hash::make(config('admin.password')),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Andere seeders uitvoeren
|
// Andere seeders uitvoeren
|
||||||
$this->call([
|
$this->call([
|
||||||
EducationSeeder::class,
|
EducationSeeder::class,
|
||||||
|
|||||||
Reference in New Issue
Block a user