laravel get parameter from url code example

Example 1: get app url in laravel

URL::to('/');

Example 2: laravel get last get request

{{ url()->previous() }}

Example 3: get value mentthod get laravel

Input::get('lastName') ;
//lastName is variable in view

Example 4: laravel get all request parameters

$request->input('name');
$request->input('user.name'); // fetch from user object

Example 5: how to see with page reuested in laravel

$request->fullUrl()

Example 6: laravel get url parameters in controller

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