photo/app/Http/Middleware/Authenticate.php

22 lines
464 B
PHP
Raw Normal View History

2016-06-20 23:35:59 +10:00
<?php
namespace App\Http\Middleware;
2019-11-08 23:08:34 +11:00
use Illuminate\Auth\Middleware\Authenticate as Middleware;
2016-06-20 23:35:59 +10:00
2019-11-08 23:08:34 +11:00
class Authenticate extends Middleware
2016-06-20 23:35:59 +10:00
{
/**
2019-11-08 23:08:34 +11:00
* Get the path the user should be redirected to when they are not authenticated.
2016-06-20 23:35:59 +10:00
*
* @param \Illuminate\Http\Request $request
2019-11-08 23:08:34 +11:00
* @return string
2016-06-20 23:35:59 +10:00
*/
2019-11-08 23:08:34 +11:00
protected function redirectTo($request)
2016-06-20 23:35:59 +10:00
{
2019-11-08 23:08:34 +11:00
if (! $request->expectsJson()) {
return route('login');
2016-06-20 23:35:59 +10:00
}
}
}