This is my route.php
Route::get('test/{paramter1}/{paramter2}', 'Somecontroller@somemethod');
In Somecontroller.php , I want these parameter like
$val_1 = Input::get('paramter1'); $val_2 = Input::get('paramter2');
and then $val_1 , $val_2 are passed to database.
How can I do that?
I have tried using the same. but it's not working.
Thank You in Advance.
You just have them as arguments for the someMethod.
public function someMethod(Request $request, $paramter1, $paramter2)
{
// Your code here...
}
Laravel will do the rest. It's detailed in the Laravel documentation under Controllers .
Try this below.
Route::get('{x}/{y}', 'PagesController@index');
public function index($x, $y)
{
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.