尝试路由我的Laravel Basic Controller
**The page isn't redirecting properly**
我试图找到我实际上做错了但却无法弄清楚
基本控制器
abstract class BaseAdminController extends Controller {
protected $whitelist = array();
/**
* The URL segment that can be used to access the system
* @var string
*/
protected $urlAdminSegment;
/**
* Initializer.
*
* @access public
* @return void
*/
public function __construct() {
//Check CSRF token on POST
$this->beforeFilter('ReportsAdmin\csrf', array('on' => array('post', 'put', 'delete')));
// Set up Auth Filters
$this->beforeFilter('ReportsAdmin\auth');
$this->beforeFilter('ReportsAdmin\inGroup:Admins', array('only' => array('show', 'index', 'create', 'add', 'destroy', 'suspend', 'unsuspend', 'ban', 'unban', 'edit', 'update')));
// Achieve that segment
$this->urlAdminSegment = Config::get('reports::app.access_url_admin');
// Setup composed views and the variables that they require
//array('except' => array('create', 'store', 'activate', 'resend', 'forgot', 'reset')));
$composed_views = array('reports::admin*');
View::composer($composed_views, 'Td\Reports\Composers\AdminPage');
}
}
过滤
Route::filter('ReportsAdmin\auth', function() {
if (!Sentry::check())
return Redirect::guest('admin/login');
});
路由
Route::get( 'admin/login' , array('as' => 'Reports\login', 'uses' => 'Td\Reports\Controllers\Backend\SessionController@create'));
return Redirect::guest('admin/login');
});