samedi 24 octobre 2015

How to pass extra parameters to controller from Laravel route

I'm trying to handle basic validation of my API calls in the Laravel's routes. Here is what I want to achieve:

Route::group(['prefix' => 'api/v1/properties/'], function () {
     Route::get('purchased', 'PropertiesController@getPropertyByProgressStatus', function () {
       //pass variable x = 1 to the controller
     });

     Route::get('waiting', 'PropertiesController@getPropertyByProgressStatus', function () {
       //pass variable x = 2 to the controller
});

});

Long story short, depending on the segment of the URI after api/v1/properties/ I want to pass a different parameter to the controller. Is there a way to do that?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire