File tree Expand file tree Collapse file tree 6 files changed +14
-15
lines changed Expand file tree Collapse file tree 6 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,6 @@ APP_URL=http://laravel-inertia-template.test
77
88BCRYPT_ROUNDS = 12
99
10- SEED_SUPER_ADMIN_EMAIL = super@laravel-inertia-template.test
11- SEED_ADMIN_EMAIL = admin@laravel-inertia-template.test
12- SEED_USER_EMAIL = user@laravel-inertia-template.test
13-
1410LOG_CHANNEL = stack
1511LOG_STACK = single
1612LOG_DEPRECATIONS_CHANNEL = null
@@ -30,7 +26,6 @@ SESSION_PATH=/
3026SESSION_DOMAIN = null
3127
3228CACHE_STORE = database
33- CACHE_PREFIX =
3429
3530BROADCAST_CONNECTION = log
3631FILESYSTEM_DISK = local
Original file line number Diff line number Diff line change @@ -7,10 +7,6 @@ APP_URL=http://laravel-inertia-template.test
77
88BCRYPT_ROUNDS = 4
99
10- SEED_SUPER_ADMIN_EMAIL = super@laravel-inertia-template.test
11- SEED_ADMIN_EMAIL = admin@laravel-inertia-template.test
12- SEED_USER_EMAIL = user@laravel-inertia-template.test
13-
1410LOG_CHANNEL = stack
1511LOG_STACK = single
1612LOG_DEPRECATIONS_CHANNEL = null
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public function show(Request $request)
1313 $ isProd = \app ()->environment ('production ' );
1414
1515 return \inertia ('Login/Show ' , [
16- 'email ' => ! $ isProd ? \env ( ' SEED_SUPER_ADMIN_EMAIL ' ) : '' ,
16+ 'email ' => ! $ isProd ? \config ( ' app.seed.emails.super ' , ' ' ) : '' ,
1717 'password ' => ! $ isProd ? '12345 ' : '' ,
1818 'remember ' => ! $ isProd ? true : false ,
1919 'redirect ' => $ request ->query ('redirect ' , '' ),
Original file line number Diff line number Diff line change 22
33return [
44
5+ 'seed ' => [
6+ 'emails ' => [
7+ 'super ' => env ('SEED_SUPER_ADMIN_EMAIL ' , 'super@laravel-inertia-template.test ' ),
8+ 'admin ' => env ('SEED_ADMIN_EMAIL ' , 'admin@laravel-inertia-template.test ' ),
9+ 'user ' => env ('SEED_USER_EMAIL ' , 'user@laravel-inertia-template.test ' ),
10+ ],
11+ ],
12+
513 /*
614 |--------------------------------------------------------------------------
715 | Application Name
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public function superAdmin(?string $email = null)
3535 {
3636 return $ this
3737 ->state (fn (array $ attributes ) => [
38- 'email ' => $ email ?: \env ( ' SEED_SUPER_ADMIN_EMAIL ' ),
38+ 'email ' => $ email ?: \config ( ' app.seed.emails.super ' ),
3939 ])
4040 ->afterCreating (function (User $ user ) {
4141 $ user ->assignRole (Role::SUPER_ADMIN ->value );
@@ -46,7 +46,7 @@ public function admin(?string $email = null)
4646 {
4747 return $ this
4848 ->state (fn (array $ attributes ) => [
49- 'email ' => $ email ?: \env ( ' SEED_ADMIN_EMAIL ' ),
49+ 'email ' => $ email ?: \config ( ' app.seed.emails.admin ' ),
5050 ])
5151 ->afterCreating (function (User $ user ) {
5252 $ user ->assignRole (Role::ADMIN ->value );
@@ -57,7 +57,7 @@ public function user(?string $email = null)
5757 {
5858 return $ this
5959 ->state (fn (array $ attributes ) => [
60- 'email ' => $ email ?: \env ( ' SEED_USER_EMAIL ' ),
60+ 'email ' => $ email ?: \config ( ' app.seed.emails.user ' ),
6161 ])
6262 ->afterCreating (function (User $ user ) {
6363 $ user ->assignRole (Role::USER ->value );
Original file line number Diff line number Diff line change 5555
5656function superAdminUser ()
5757{
58- return User::whereEmail (env ( ' SEED_SUPER_ADMIN_EMAIL ' ))->first ();
58+ return User::whereEmail (\config ( ' app.seed.emails.super ' ))->first ();
5959}
6060
6161function adminUser ()
6262{
63- return User::whereEmail (env ( ' SEED_ADMIN_EMAIL ' ))->first ();
63+ return User::whereEmail (\config ( ' app.seed.emails.admin ' ))->first ();
6464}
You can’t perform that action at this time.
0 commit comments