0
Я пытаюсь внедрить базовое промежуточное программное обеспечение в Laravel 5.0, но почему-то я не понимаю, что он использует то же пространство имен для контракта Guard, что и мое промежуточное ПО. Ниже приведен код и исключение, которое я рассматриваю.Reflection Exception Guard Contract Laravel 5.0
<?php namespace App\Http\Middleware;
use Closure;
use Illuminate\Contracts\Auth\Guard;
class LoginMiddleWare {
/**
* Gaurd Implementation
* @var Gaurd
*/
protected $auth;
/**
* Create a new filter instance.
*
* @param Guard $auth
* @return void
*/
public function __construct(Gaurd $auth)
{
$this->auth = $auth;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if(!$this->auth->check())
{
return redirect()->route('login');
}
return $next($request);
}
}
ReflectionException в compiled.php линии 1050: класса App \ Http \ Middleware \ Gaurd не существует