2017-05-22 67 views
0

FatalErrorException在web.php線23: 語法錯誤,意想不到的 '@',期望 ']'FatalErrorException在web.php線23:語法錯誤,意想不到的 '@',期望 ']'

Route::get('/' , ['as' => '/' , 'uses'=>[email protected]]); 
Route::post('/login', ['as' => 'login', 'uses'=>[email protected]]); 

Route::get('/logout' ,['as'=>'logout', 'uses'=>[email protected]]); 

Route::group(['middleware'=>['authen','roles']],function(){ 
    Route::get('/dashboard',['as'=>'dashboard', 'uses'=>[email protected]]); 
}); 

我不知道是什麼問題..它顯示FatalErrorException在web.php線23: 語法錯誤,意想不到的 '@',希望 ']'

回答

1

uses值必須是字符串:

Route::get('/' , ['as' => '/' , 'uses'=> '[email protected]']); 
Route::post('/login', ['as' => 'login', 'uses'=>'[email protected]']); 

Route::get('/logout' ,['as'=>'logout', 'uses'=>'[email protected]']); 

Route::group(['middleware'=>['authen','roles']],function(){ 
    Route::get('/dashboard',['as'=>'dashboard', 'uses'=>'[email protected]']); 
}); 
+0

謝謝先生! :)你真棒:) –

+0

@prakashpokhrel我認爲你應該接受這個答案 –

+0

不客氣。如果正確,請接受它。 –

相關問題