Just use helper function in middleware.

This commit is contained in:
Taylor Otwell 2015-03-01 21:35:37 -06:00
parent 055edad216
commit c9c0380b34
1 changed files with 1 additions and 2 deletions

View File

@ -2,7 +2,6 @@
use Closure;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Http\RedirectResponse;
class RedirectIfAuthenticated
{
@ -35,7 +34,7 @@ public function __construct(Guard $auth)
public function handle($request, Closure $next)
{
if ($this->auth->check()) {
return new RedirectResponse(url('/home'));
return redirect('/home');
}
return $next($request);