Ekapp/skolehjem/app/Http/Middleware/Authenticate.php

22 lines
475 B
PHP
Raw Normal View History

2020-06-08 08:04:45 +00:00
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string|null
*/
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
2020-06-30 08:04:06 +00:00
return route('users.login');
2020-06-08 08:04:45 +00:00
}
}
}