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,
'bindings' => SubstituteBindings::class,
'recaptcha' => VerifyReCaptcha::class,
'maintenance' => MaintenanceMiddleware::class,
'node.maintenance' => MaintenanceMiddleware::class,
// Server specific middleware (used for authenticating access to resources)
//

View file

@ -33,7 +33,7 @@ class RouteServiceProvider extends ServiceProvider
->namespace($this->namespace . '\Auth')
->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')
->group(base_path('routes/server.php'));

View file

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