samedi 27 mai 2017

Do I have to save every route in Laravel?

I've started using laravel instead of codeigniter. Do I have to save every path in the routes file? In codeigniter I don't I can use any path in my code without having to define it. I just started working on a small project and got many routes which will increase to be 500+ or so

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');
});

Is there any way to make it work like codeigniter without having to define every path?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2s1gg6X
via IFTTT

Aucun commentaire:

Enregistrer un commentaire