
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
- FirstOrCreate() Not Inserting Model
- How to remove package from laravel
- Get current month records in laravel 7/8
- Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails
- Delete records with relationship in laravel
- The use statement with non-compound name 'Auth' has no effect
- How to insert ckeditor data into database in Laravel?
- Remove array keys and values if it does not exist in other array in Laravel
- Laravel create default admin user
- SQLSTATE[23000]: Integrity constraint violation: 1022 Can't write; duplicate key in table
- Attempt to read property "avatar" on null in Laravel
- Drop foreign key column in Laravel using migration
- Delete all related comments on deleting a post in Laravel
- How to get single column value in laravel
- Add class to body in laravel view
- Laravel append URI in route
- Class 'App\Http\Controllers\User' not found
- Target class [HomeController] does not exist
- If no route matched route::fallback in laravel
- Comment .env file in laravel
- Display data in table using foreach in Laravel
- How to display order by null last in laravel
- How to create laravel project using composer
- How to get user information using hootlex/laravel-friendships package in laravel
- Permanently delete a record in laravel