...
This commit is contained in:
parent
6b926d3afe
commit
b716ab5836
4 changed files with 3 additions and 10 deletions
|
|
@ -3,13 +3,6 @@ php spark make:controller Api/Auth --suffix --restful
|
|||
```
|
||||
|
||||
|
||||
Routes.php
|
||||
```php
|
||||
//Get
|
||||
$routes->get("logout", "AuthController::logout", ["filter" => "apiauth"]);
|
||||
```
|
||||
|
||||
|
||||
Api/AuthController.php
|
||||
```php
|
||||
<?php
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ service('auth')->routes($routes)
|
|||
|
||||
```php
|
||||
// API routes (put below service('auth'))
|
||||
$routes->group("api", ["namespace" => "App\Controller\Api"], function($routes) {
|
||||
$routes->group("api", ["namespace" => "App\Controllers\Api"], function($routes) {
|
||||
$routes->post("register", "AuthController::register");
|
||||
$routes->post("login", "AuthController::login");
|
||||
$routes->get("profile", "AuthController::profile");
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ Routes.php
|
|||
$routes->group("api",["namespace]=> "App\Controllers\Api"], function($routes) {
|
||||
...
|
||||
$routes->get("invalid-access", "AuthController::accessDenied");
|
||||
§routes->get('demo-method", "AuthController::demoMethod",["filter" => "apiauth"]); // Filter Name is defined in aliases array in Filters.php below.
|
||||
$routes->get('demo-method", "AuthController::demoMethod",["filter" => "apiauth"]); // Filter Name is defined in aliases array in Filters.php below.
|
||||
...
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue