标签:resource ajax 路由 his ons cti content suse login
Route::group([‘prefix‘ => ‘console‘, ‘middleware‘ => ‘auth‘], function(){
Route::any(‘/‘, ‘console\HomeController@index‘);
Route::resource(‘home‘, ‘console\HomeController‘);
Route::resource(‘content‘, ‘console\ContentController‘);
Route::resource(‘article‘, ‘console\ArticleController‘);
Route::resource(‘article_type‘, ‘console\ArticleTypeController‘);
Route::resource(‘article_tag‘, ‘console\ArticleTagController‘);
} );
public function handle($request, Closure $next)
{
if ($this->auth->guest())
{
if ($request->ajax())
{
return response(‘Unauthorized.‘, 401);
}
else
{
return redirect()->guest(‘console/auth/login‘);
}
}
return $next($request);
}
php artisan tinker
标签:resource ajax 路由 his ons cti content suse login
原文地址:http://www.cnblogs.com/lv448395223/p/6133600.html