How to Redirect a named route with query string in Laravel

How to Redirect a named route with query string in Laravel

Sometime you need to pass extra parameter as query string in Laravel route that is not part of a route parameters so don't worry, you can pass everything as query string in route that is defined in route parameter.

Simple Redirect to Named Routes
return redirect()->route('dashboard');
Redirect named route with query string
  1. return redirect()->route('dashboard',['product_id'=>1])
  2. ->with('message','Welcome to ExpertPHP.');

Here i am passing message variable as Flashed Session Data which you can use in your view to display message.

Redirect to Controller Action

You can also redirect to controller action, for this pass the controller name with action.

return redirect()->action('UserController@dashboard');
Redirect to another URL
 return redirect('user/dashboard');

Phone: (+91) 8800417876
Noida, 201301
sakarya escort akyazı escort arifiye escort erenler escort eve gelen escort ferizli escort geyve escort hendek escort otele gelen escort sapanca escort söğütlü escort taraklı escort
escort bayan escort bayan escort bayan escort bayan escort bayan escort bayan escort bayan sakarya escort sakarya escort sakarya escort sakarya escort sakarya escort sakarya escort sakarya escort adapazarı escort adapazarı escort adapazarı escort adapazarı escort adapazarı escort adapazarı escort adapazarı escort serdivan escort serdivan escort serdivan escort serdivan escort serdivan escort serdivan escort serdivan escort sakarya escort bayan sakarya escort bayan sakarya escort bayan sakarya escort bayan sakarya escort bayan sakarya escort bayan sakarya escort bayan escort sakarya escort sakarya escort sakarya escort sakarya escort sakarya escort sakarya escort sakarya serdivan escort sapanca escort karasu escort hendek escort izmir escort