我开始使用laravel而不是codeigniter。我是否必须保存路径文件中的每个路径?在codeigniter中我不能在我的代码中使用任何路径而不必定义它。我刚刚开始研究一个小项目并获得了许多路线,这些路线将增加到500+左右
Route::group(['middleware' => 'auth'], function()
{
Route::get('/home', 'HomeController@index');
Route::post('/like_unlike' , 'HomeController@like_unlike');
Route::get('/profile' , 'UserController@index');
Route::post('/update_profile' , 'UserController@update_profile');
Route::post('/add_comment' , 'HomeController@add_comment');
Route::post('/sendMsg' , 'HomeController@send_message');
Route::post('/countMsgs' , 'HomeController@count_new_msgs');
Route::post('/countNewMsgs' , 'HomeController@count_unread_msgs');
Route::post('/countNot' , 'HomeController@count_new_not');
Route::post('/countNewNot' , 'HomeController@count_unread_not');
Route::post('/upload' , 'HomeController@uploadImg');
Route::get('/messages' , 'MessageController@index');
Route::post('/getLast30Msgs' , 'MessageController@getLast30Msgs');
Route::post('/checkNewMsgsFromUserId' , 'MessageController@checkNewMsgsFromUserId');
});
有没有办法让它像codeigniter一样工作而不必定义每条路径?
答案 0 :(得分:0)