我在laravel新的,我要創建我的應用程序中運行(我不想使用laravel默認登錄系統)中間件在laravel除了每隔一個HTTP請求到應用程序5.1
我想用中間件在我的應用程序每一個HTTP請求中,除了一個
在laravel 5.1機制的文檔syas運行,我可以使用全球中間件但我想不使用中間件只需登錄頁面。 我該怎麼辦? 這是我的中間件:
<?php
namespace App\Http\Middleware;
use Closure;
class Admin
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if(! session()->has('Login') )
{
return redirect('login');
}
return $next($request);
}
}
告訴我們你的'routes.php'頁 – Derek