0
I’m sending a parameter in a view href="{{route('products.index', 'E')}}"
I need to receive this parameter 'E'
in a variable in the controller
and send via compact();
in another view
follow my route:
Route::resource('products', 'ProductController');
follows my controller:
public function index(Request $request)
{
$btn = $request->all();
dd($btn);
// $products = Product::latest()->paginate(5);
//
// return view('products.index', compact('products','btn'))
// ->with('i', (request()->input('page', 1) -1)* 5);
}
nesse dd($btn); a variável me retorna null como mostra abaixo.
array:1 [▼
"E" => null
]
in this case would like to receive in the variable $btn
the information 'E'
, someone knows how could be doing this?
Note: I am using controller Resource.
To get what I wanted to do, I just put the parameter {{route('products.index', 'id=E')}} I recovered the parameter in the controller
– teste