mardi 27 novembre 2018

Laravel $request->input('var') returns null in Controller

//routes

Route::get('/section/{id}', 'Controller@section');

//controller

public function section(Request $request) {
  $id = $request->input('id');
  dd($id);
}

//output

null

  1. there is no problem to retrieve $id, if I try to retrieve inside Route through function($id){}.
  2. no other kind of errors shown.

Thank you.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire