Skip to content

Commit

Permalink
Add middleware to config.
Browse files Browse the repository at this point in the history
  • Loading branch information
asvae committed Jul 18, 2016
1 parent 01829e0 commit f2b57dd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ And edit `config/api-tester.php` as you please.
## Features
* Display all the routes for application.
* Live search and sortable columns.
* CSRF token is handled for you.
* Define request body in [JSON editor](https://github.com/josdejong/jsoneditor).
* Preview response depending on type (html or json).
* [Material design lite](https://getmdl.io/) as theme.
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function map(Router $router)
{
$router->group([
'namespace' => $this->getNamespace(),
'middleware' => ['web'],
'middleware' => config('api-tester.middleware'),
], function () {
$this->requireRoutes();
});
Expand Down
5 changes: 0 additions & 5 deletions src/api-tester.php

This file was deleted.

14 changes: 13 additions & 1 deletion src/config/api-tester.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,17 @@
|
*/

'enabled' => env('APP_DEBUG', false)
'enabled' => env('APP_DEBUG', false),

/*
|--------------------------------------------------------------------------
| Middleware
|--------------------------------------------------------------------------
|
| Define list of middleware(s), that should be used for api-tester.
| CRSF token will be handled automatically.
|
*/

'middleware' => ['web'],
];

0 comments on commit f2b57dd

Please sign in to comment.