vendredi 30 décembre 2016

Passing parameter from route to controller in laravel

I am trying to pass a variable from route to controller. But not able to succeed.

my route entry is as below

Route::get('/Register', 'NewRegister@CheckCand');

now in the controller file I want to get one parameter. My controller function is as below

public function CheckCand()
{
    echo $ID;
}

Now how do I pass a variable ID from route to controller. But i don't want to pass it in the URL and also in get function i dont want to change '/Register'.

Route::get('/Register', 'NewRegister@CheckCand');

Means it will be like a Hidden parameter passed from route to controller. Might be question is confusing but i don't know how to explain better.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire