修改路由规则,在问题列表的路由上加上 登陆策略即可,修改的文件是 routes/web.php ,代码如下
Route::get('/questions/{category_name?}/{filter?}',['middleware'=>'auth','as'=>'website.ask','uses'=>'IndexController@ask'])->where(['filter'=>'(newest|hottest|reward|unAnswered)']);
主要是加入了
'middleware'=>'auth'