How to get url parameter in controller in laravel?
my view of the blade .....
tableHtml += "<td><a href= '{{url('/add')}}/" + data.hits[i].recipe.label + "'> add to favotite</a></td>"; when i click add to fav .... i get this in url
http: // localhost / lily / public / add / Chilli% 20Green% 20Salad
///web.php
Route::get('/add', ' HomeController@add '); //// controller ...... how can I get the name of the url in the controller .....
public function add(Request $request) { $request->get("") ////////////how can i get the string i passed on url } +5
4 answers