photo/app/Http/Middleware/Authenticate.php

22 lines
464 B
PHP
Raw Normal View History

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