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
7
7
8
8
BCRYPT_ROUNDS = 12
9
9
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
-
14
10
LOG_CHANNEL = stack
15
11
LOG_STACK = single
16
12
LOG_DEPRECATIONS_CHANNEL = null
@@ -30,7 +26,6 @@ SESSION_PATH=/
30
26
SESSION_DOMAIN = null
31
27
32
28
CACHE_STORE = database
33
- CACHE_PREFIX =
34
29
35
30
BROADCAST_CONNECTION = log
36
31
FILESYSTEM_DISK = local
Original file line number Diff line number Diff line change @@ -7,10 +7,6 @@ APP_URL=http://laravel-inertia-template.test
7
7
8
8
BCRYPT_ROUNDS = 4
9
9
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
-
14
10
LOG_CHANNEL = stack
15
11
LOG_STACK = single
16
12
LOG_DEPRECATIONS_CHANNEL = null
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public function show(Request $request)
13
13
$ isProd = \app ()->environment ('production ' );
14
14
15
15
return \inertia ('Login/Show ' , [
16
- 'email ' => ! $ isProd ? \env ( ' SEED_SUPER_ADMIN_EMAIL ' ) : '' ,
16
+ 'email ' => ! $ isProd ? \config ( ' app.seed.emails.super ' , ' ' ) : '' ,
17
17
'password ' => ! $ isProd ? '12345 ' : '' ,
18
18
'remember ' => ! $ isProd ? true : false ,
19
19
'redirect ' => $ request ->query ('redirect ' , '' ),
Original file line number Diff line number Diff line change 2
2
3
3
return [
4
4
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
+
5
13
/*
6
14
|--------------------------------------------------------------------------
7
15
| Application Name
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public function superAdmin(?string $email = null)
35
35
{
36
36
return $ this
37
37
->state (fn (array $ attributes ) => [
38
- 'email ' => $ email ?: \env ( ' SEED_SUPER_ADMIN_EMAIL ' ),
38
+ 'email ' => $ email ?: \config ( ' app.seed.emails.super ' ),
39
39
])
40
40
->afterCreating (function (User $ user ) {
41
41
$ user ->assignRole (Role::SUPER_ADMIN ->value );
@@ -46,7 +46,7 @@ public function admin(?string $email = null)
46
46
{
47
47
return $ this
48
48
->state (fn (array $ attributes ) => [
49
- 'email ' => $ email ?: \env ( ' SEED_ADMIN_EMAIL ' ),
49
+ 'email ' => $ email ?: \config ( ' app.seed.emails.admin ' ),
50
50
])
51
51
->afterCreating (function (User $ user ) {
52
52
$ user ->assignRole (Role::ADMIN ->value );
@@ -57,7 +57,7 @@ public function user(?string $email = null)
57
57
{
58
58
return $ this
59
59
->state (fn (array $ attributes ) => [
60
- 'email ' => $ email ?: \env ( ' SEED_USER_EMAIL ' ),
60
+ 'email ' => $ email ?: \config ( ' app.seed.emails.user ' ),
61
61
])
62
62
->afterCreating (function (User $ user ) {
63
63
$ user ->assignRole (Role::USER ->value );
Original file line number Diff line number Diff line change 55
55
56
56
function superAdminUser ()
57
57
{
58
- return User::whereEmail (env ( ' SEED_SUPER_ADMIN_EMAIL ' ))->first ();
58
+ return User::whereEmail (\config ( ' app.seed.emails.super ' ))->first ();
59
59
}
60
60
61
61
function adminUser ()
62
62
{
63
- return User::whereEmail (env ( ' SEED_ADMIN_EMAIL ' ))->first ();
63
+ return User::whereEmail (\config ( ' app.seed.emails.admin ' ))->first ();
64
64
}
You can’t perform that action at this time.
0 commit comments