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

Commit 5645f07

Browse files
committed
👽 updated example base controller
1 parent 92278fa commit 5645f07

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

app/controllers/Controller.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@
66
use Leaf\Auth;
77

88
/**
9-
* This is the base controller for your Leaf API Project.
9+
* This is the base controller for your Leaf MVC Project.
1010
* You can initialize packages or define methods here to use
1111
* them across all your other controllers which extend this one.
1212
*/
13-
class Controller extends \Leaf\ApiController
13+
class Controller extends \Leaf\Controller
1414
{
15-
public function __construct()
16-
{
17-
parent::__construct();
15+
public function __construct()
16+
{
17+
parent::__construct();
1818

19-
// In this version, request isn't initialised for you. You can use
20-
// requestData() or request() to get request data or initialise it yourself
19+
// In this version, request isn't initialised for you. You can use
20+
// requestData() or request() to get request data or initialise it yourself
2121

22-
// autoConnect uses the .env variables to quickly connect to db
23-
Auth::autoConnect();
22+
// autoConnect uses the .env variables to quickly connect to db
23+
Auth::autoConnect();
2424

25-
// set default token expiry time
26-
Auth::tokenLifetime(60 * 60 * 24 * 365);
25+
// You can configure auth to get additional customizations
26+
// This can be done here with the Auth::config method or
27+
// simply in the config/auth.php file
28+
Auth::config(AuthConfig());
2729

28-
// You can configure auth to get additional customizations
29-
// This can be done here with the Auth::config method or
30-
// simply in the Config/auth.php file
31-
Auth::config(AuthConfig());
30+
// You can refer to https://leafphp.dev/modules/auth for auth docs
3231

33-
// You can refer to https://leafphp.netlify.app/#/leaf/v/2.5/core/auth for auth docs
34-
}
32+
// To use session instead of JWT, open up config/auth.php and set
33+
// USE_SESSION to true
34+
}
3535
}

0 commit comments

Comments
 (0)