Skip to content

Commit f2b57dd

Browse files
committed
Add middleware to config.
1 parent 01829e0 commit f2b57dd

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ And edit `config/api-tester.php` as you please.
3434
## Features
3535
* Display all the routes for application.
3636
* Live search and sortable columns.
37+
* CSRF token is handled for you.
3738
* Define request body in [JSON editor](https://github.com/josdejong/jsoneditor).
3839
* Preview response depending on type (html or json).
3940
* [Material design lite](https://getmdl.io/) as theme.

src/Providers/RouteServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function map(Router $router)
2424
{
2525
$router->group([
2626
'namespace' => $this->getNamespace(),
27-
'middleware' => ['web'],
27+
'middleware' => config('api-tester.middleware'),
2828
], function () {
2929
$this->requireRoutes();
3030
});

src/api-tester.php

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/config/api-tester.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,17 @@
1212
|
1313
*/
1414

15-
'enabled' => env('APP_DEBUG', false)
15+
'enabled' => env('APP_DEBUG', false),
16+
17+
/*
18+
|--------------------------------------------------------------------------
19+
| Middleware
20+
|--------------------------------------------------------------------------
21+
|
22+
| Define list of middleware(s), that should be used for api-tester.
23+
| CRSF token will be handled automatically.
24+
|
25+
*/
26+
27+
'middleware' => ['web'],
1628
];

0 commit comments

Comments
 (0)