Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit c3a041a

Browse files
committed
feat: update config
1 parent 49b30a4 commit c3a041a

File tree

3 files changed

+63
-11
lines changed

3 files changed

+63
-11
lines changed

config/auth.php

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
| Use session based authentication instead of the default JWT based auth.
2323
|
2424
*/
25-
'USE_SESSION' => false,
25+
'USE_SESSION' => true,
2626

2727
/*
2828
|--------------------------------------------------------------------------
@@ -35,6 +35,17 @@
3535
*/
3636
'USE_TIMESTAMPS' => true,
3737

38+
/*
39+
|--------------------------------------------------------------------------
40+
| Set timestamps format
41+
|--------------------------------------------------------------------------
42+
|
43+
| Use this property to specify the format that you want your timestamps to be saved in.
44+
| Be aware that auth uses the leafs/date module, so the accepted formats are listed in the leafs/date documentation
45+
|
46+
*/
47+
'TIMESTAMP_FORMAT' => 'c',
48+
3849
/*
3950
|--------------------------------------------------------------------------
4051
| Encode password
@@ -77,6 +88,17 @@
7788
*/
7889
'PASSWORD_KEY' => 'password',
7990

91+
/*
92+
|--------------------------------------------------------------------------
93+
| ID Key
94+
|--------------------------------------------------------------------------
95+
|
96+
| Set your primary key name. For instance, you might have used id_user instead of id.
97+
| This setting allows you to quickly switch your key name
98+
|
99+
*/
100+
'ID_KEY' => 'id',
101+
80102
/*
81103
|--------------------------------------------------------------------------
82104
| Hide id
@@ -128,6 +150,42 @@
128150
*/
129151
'SESSION_ON_REGISTER' => false,
130152

153+
/*
154+
|--------------------------------------------------------------------------
155+
| Session redirect on login
156+
|--------------------------------------------------------------------------
157+
|
158+
| When set to true, the options set in GUARD_LOGIN, GUARD_REGISTER and GUARD_HOME
159+
| will be used to redirect the user to the right page based on their state.
160+
| Set to false to not redirect on login
161+
|
162+
*/
163+
'SESSION_REDIRECT_ON_LOGIN' => true,
164+
165+
/*
166+
|--------------------------------------------------------------------------
167+
| Session redirect on register
168+
|--------------------------------------------------------------------------
169+
|
170+
| When set to true, the options set in GUARD_LOGIN, GUARD_REGISTER and GUARD_HOME
171+
| will be used to redirect the user to the right page based on their state.
172+
| Set to false to not redirect on login
173+
|
174+
*/
175+
'SESSION_REDIRECT_ON_REGISTER' => true,
176+
177+
/*
178+
|--------------------------------------------------------------------------
179+
| Session lifetime
180+
|--------------------------------------------------------------------------
181+
|
182+
| Set the lifetime of the session. After this time, the session will expire and the user will have to login again.
183+
| You can either use '1 day' format or as an integer: 86400
184+
| You can also set SESSION_LIFETIME to 0 to disable session expiration.
185+
|
186+
*/
187+
'SESSION_LIFETIME' => 60 * 60 * 24,
188+
131189
/*
132190
|--------------------------------------------------------------------------
133191
| Login page route
@@ -161,7 +219,7 @@
161219
| JWT + Session
162220
|--------------------------------------------------------------------------
163221
|
164-
| Add an auth token to the auth session?
222+
| Add an auth token to the auth session
165223
|
166224
*/
167225
'SAVE_SESSION_JWT' => false,
@@ -184,5 +242,5 @@
184242
| How long should JWT be valid for?
185243
|
186244
*/
187-
'TOKEN_LIFETIME' => 60 * 60 * 24 * 365,
245+
'TOKEN_LIFETIME' => 60 * 60 * 24 * 365
188246
];

config/paths.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
*/
1313

1414
return [
15-
'assets' => 'public/assets',
16-
1715
'commands' => 'app/console',
1816

1917
'config' => 'config',
@@ -36,16 +34,14 @@
3634

3735
'lib' => 'lib',
3836

39-
'mail' => 'app/mailers',
37+
'mail' => 'app/mail',
4038

4139
'middleware' => 'app/middleware',
4240

4341
'migrations' => 'app/database/migrations',
4442

4543
'models' => 'app/models',
4644

47-
'public' => 'public',
48-
4945
'routes' => 'app/routes',
5046

5147
'schema' => 'app/database/schema',

config/view.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
use Leaf\View;
4-
53
return [
64
/*
75
|--------------------------------------------------------------------------
@@ -23,7 +21,7 @@
2321
|
2422
*/
2523
'config' => function ($config) {
26-
View::blade()->configure($config['views'], $config['cache']);
24+
\Leaf\Config::get('views.blade')->configure($config['views'], $config['cache']);
2725
},
2826

2927
/*

0 commit comments

Comments
 (0)