Redirect to another view from controller in laravel
Created at 25-Aug-2021 ,
By samar
Redirect to another view from controller in laravel
Through many examples, we will learn how to resolve the "Redirect to another view from controller in laravel".
You can redirect to two different views from the controller on the basis of condition. If the condition for the return to the specific view is true it will return to the view otherwise it will return to the another view.-
Return to two different view on the basis of if condition
if($conditionTrue){ return view('dashboard'); } return view('home');
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
Don't forget to share this article! Help us spread the word by clicking the share button below.
We appreciate your support and are committed to providing you valuable and informative content.
We are thankful for your never ending support.
Random Code Snippet Queries: Laravel
- Extra Filter Query on Relationships in Laravel
- Get last record from table in laravel
- Laravel create default admin user
- Get current month records in laravel 7/8
- How to return error message from controller to view in laravel
- Validation for multiple forms on same page in laravel
- How to pass variable from controller to model in Laravel
- File_put_contents(/var/www/html/w3code/storage/framework/sessions/CXwN3EXKxERD6jgy3rADcaAAbAx8FRKih2JK7UO9): Failed to open stream: Permission denied
- Conditional validation in laravel
- How to get column names from table in Laravel
- Extract only time from datetime in laravel
- If condition in Laravel 9
- How to validate form input data in laravel
- How to display HTML tags In Laravel blade
- Declaration of App\Models\Post::sluggable() must be compatible with Cviebrock\EloquentSluggable\Sluggable
- How to pass query string to url in laravel
- How to get IP address in laravel
- How to display 1 day ago in comments in laravel view
- How to authenticate admin users in Laravel ?
- How to create laravel project using composer
- How to pass data to multiple partial view files in laravel
- Php artisan make model, factory, migration and controller in single command
- How to add dynamic page title in Laravel view
- Laravel pagination links with query string
- How to prevent host header attack in Laravel