laravel get current url with parameters code example

Example 1: current URL without url site laravel

is work
{{Request::path()}}
or
request()->path()

Example 2: how to get variable from url in laravel

request('variable')

Example 3: current url route laravel

\Route::current()
############### OR ####################
$request->getRequestUri()

Example 4: laravel get url parameters in controller

public function update($name)
{
    User::where('name', $name)->first();
    return view('test')->with('user', $user);
}

Example 5: laravel get url parameters in controller

Route::put('user/{name}', 'UserController@show');