get url parameter in laravel view code example
Example 1: laravel get url parameters in controller
public function update($name)
{
User::where('name', $name)->first();
return view('test')->with('user', $user);
}
Example 2: laravel get url parameter value in controller
// url : https://www.example.com/param1/param2/param3
$request()->segment(3); // param3