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
sakarya escort - akyazı escort - arifiye escort - erenler escort - eve gelen escort - ferizli escort - geyve escort - hendek escort - karapürçek escort - karasu escort - kaynarca escort - kocaali escort - otele gelen escort - pamukova escort - sapanca escort - söğütlü escort - taraklı escort
sapanca escort hendek escort karasu escort escort sakarya sakarya escort bayan adapazarı escort sakarya escort sakarya escort sakarya escort sakarya escort sakarya escort sakarya escort