This commit is contained in:
Torsten 2024-12-22 15:51:00 +01:00
parent 6b926d3afe
commit b716ab5836
4 changed files with 3 additions and 10 deletions

View file

@ -7,7 +7,7 @@ Source:
Prerequisites: Have correct docker compose installed:
```bash
sudo apt install docker-compose-v2
```
Download Devilbox

View file

@ -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

View file

@ -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");

View file

@ -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.
...
```