@aubrey
To pass a parameter from a request in Laravel, you can do so by using the request()
helper function. Here is an example of how you can pass a parameter from a request to a controller method in Laravel:
1
|
Route::get('/example/{param}', 'ExampleController@exampleMethod'); |
1 2 3 4 |
public function exampleMethod($param){ // Do something with the parameter return $param; } |
1
|
http://yourwebsite.com/example/parameterValue |
The parameter will be passed to the exampleMethod
in the ExampleController
class and you can use it however you need within the method.