Answer the question
In order to leave comments, you need to log in
How to pass get parameters to controller method?
Api method at:
site/api/registration
Takes 4 parameters in the get request:
site/api/registration?var1=1&var2=2&var3=3&var4=
4 their values in the corresponding arguments:
public function registration( var1, var2, var3, var4)
{
return 'registerUser';
}
Route::get('api/registration/var1/{var1}/var2/{var2}', ['uses' =>'[email protected]', 'as'=>'registration']);
Route::get('api/registration?var1={var1}&var2={var2}', ['uses' =>'[email protected]', 'as'=>'registration']);
Answer the question
In order to leave comments, you need to log in
no route should be written for it.
api/registration and all
GET parameters are not part of the link.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question