Renamed middleware, and fixed the test

This commit is contained in:
stanjg 2018-05-31 16:40:18 +02:00
parent 013dde75ae
commit ccf3e3511f
No known key found for this signature in database
GPG Key ID: 27D9DF9D28935303
3 changed files with 3 additions and 3 deletions

View File

@ -109,7 +109,7 @@ class Kernel extends HttpKernel
'can' => Authorize::class, 'can' => Authorize::class,
'bindings' => SubstituteBindings::class, 'bindings' => SubstituteBindings::class,
'recaptcha' => VerifyReCaptcha::class, 'recaptcha' => VerifyReCaptcha::class,
'maintenance' => MaintenanceMiddleware::class, 'node.maintenance' => MaintenanceMiddleware::class,
// Server specific middleware (used for authenticating access to resources) // Server specific middleware (used for authenticating access to resources)
// //

View File

@ -33,7 +33,7 @@ class RouteServiceProvider extends ServiceProvider
->namespace($this->namespace . '\Auth') ->namespace($this->namespace . '\Auth')
->group(base_path('routes/auth.php')); ->group(base_path('routes/auth.php'));
Route::middleware(['web', 'csrf', 'auth', 'server', 'subuser.auth', 'maintenance'])->prefix('/server/{server}') Route::middleware(['web', 'csrf', 'auth', 'server', 'subuser.auth', 'node.maintenance'])->prefix('/server/{server}')
->namespace($this->namespace . '\Server') ->namespace($this->namespace . '\Server')
->group(base_path('routes/server.php')); ->group(base_path('routes/server.php'));

View File

@ -46,7 +46,7 @@ class MaintenanceMiddlewareTest extends MiddlewareTestCase
public function testHandleInMaintenanceMode() public function testHandleInMaintenanceMode()
{ {
$server = factory(Server::class)->make(); $server = factory(Server::class)->make();
$node = factory(Node::class)->make(['maintenance' => 1]); $node = factory(Node::class)->make(['maintenance_mode' => 1]);
$server->setRelation('node', $node); $server->setRelation('node', $node);
$this->setRequestAttribute('server', $server); $this->setRequestAttribute('server', $server);