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
- How to use bootstrap pagination in laravel 8
- Php artisan make model, factory, migration and controller in single command
- Get last week data in Laravel
- Non-static method App\Http\Helper::myFunction() should not be called statically
- How to get all route list
- How to check column value of a record is null or not in laravel
- How to get last record from object collection in laravel
- Show old value while editing the form in Laravel
- Laravel csrf token mismatch for ajax POST Request
- How to create and run user seeder in laravel
- Fatal error: Uncaught Error: Class "Illuminate\Foundation\Application" not found
- How to Run CRON Job on LIVE SERVER on Cpanel in Laravel Project
- How to pass link from controller to view in laravel on ajax call
- Route [password.request] not defined
- Laravel 11 step by step instructions to upload file in storage directory and display in blade file
- Count all and get 10 records after where condition in laravel
- How to display user profile after login in laravel
- Get Array of IDs from Eloquent Collection
- Define variable and use in Laravel controller method
- How to create laravel project using composer
- How to display pivot table column value in laravel
- Laravel delete all rows older than 30 days
- How to get date from created_at field in laravel
- Insert values in pivot table dynamically in laravel
- Permission denied error while creating storage link in Laravel