Laravel 11 Tutorial with MongoDB #116 | Display Orders in Admin Panel (III) | Update Order Status
Hellow guys, Welcome to my website, and you are watching Laravel 11 Tutorial with MongoDB #116 | Display Orders in Admin Panel (III) | Update Order Status. and this vIdeo is uploaded by Stack Developers at 2024-09-19T06:30:12-07:00. We are pramote this video only for entertainment and educational perpose only. So, I hop you like our website.
Info About This Video
Name |
Laravel 11 Tutorial with MongoDB #116 | Display Orders in Admin Panel (III) | Update Order Status |
Video Uploader |
Video From Stack Developers |
Upload Date |
This Video Uploaded At 19-09-2024 13:30:12 |
Video Discription |
►Laravel 11 Tutorial (with MongoDB): https://www.youtube.com/playlist?list=PLLUtELdNs2ZYTn3ft4BMaAilhZJYLMs9d
This is Part 116 of the Laravel 11 Tutorial, in which we are building the e-commerce website with Laravel as the front end and MongoDB as the back end.
In this part, we will work on updating the order status of every order manually.
We will create order_statuses table with migration and will also add few status in it with Seeding. We will also create model for order statuses.
1) Create order_statuses collection :-
First of all, we will create an order_statuses collection with below columns:-
id, name and status
So, we will run the below artisan command to create a migration file and model for order_statuses collection:-
php artisan make:Model OrderStatus -m
Open create_order_statuses_table migration file and add all required columns mentioned earlier.
Now, we will run below artisan command to create order_statuses table with required columns :-
php artisan migrate
Now order_statuses table has been created with all the required columns.
Also, Replace default class with MongoDB Class in DeliveryAddress model:-
use MongoDB\Laravel\Eloquent\Model as Model;
Now, We will create Seeding for order_statuses table to insert few status from seeder command.
2) Writing Seeder / Create OrderStatusTableSeeder file :-
First of all, we will generate seeder and create OrderStatusTableSeeder file from where we will add few order status for order_statuses table.
Run below artisan command to generate Seeder and create OrderStatusTableSeeder file :-
php artisan make:seeder OrderStatusTableSeeder
Above command will create OrderStatusTableSeeder.php file at \database\seeds\
Now open OrderStatusTableSeeder file and add record for order status.
3) Update DatabaseSeeder.php file :-
Now update DatabaseSeeder.php file located at database/seeds/ to add OrderStatusTableSeeder class as shown in video.
4) Run below commands :-
Now run below commands that will finally insert product into order_statuses table.
composer dump-autoload (if required)
php artisan db:seed --class=OrderStatusTableSeeder
Now we will show order status dynamically in order detail page in admin panel so that the client can manually update the order status when required.
5) Update orderDetails function :-
Now, we will update orderDetails function at OrderController to get all order status from order_statuses table and return to order detail page in the admin panel.
6) Update order_details.blade.php file :-
Now we will update order_details.blade.php file to show all order status dynamically in foreach loop in select option. We will also add form with order_id as hidden.
7) Create Route:-
Now we will create a POST route in the web.php file for updating order status:-
// Update Order Status
Route::post('update-order-status',[OrderController::class,'updateOrderStatus']);
8) Create updateOrderStatus function :-
Now we will create updateOrderStatus function at OrderController to update the order status of particular order and return success message.
9) Update order_details.blade.php file :-
Update the order_details.blade.php file once again to show a success message after updating the order status.
In the next part, we will work on the Order Email that we will send on COD order placement.
►Click here to subscribe for Laravel & other updates - https://www.youtube.com/stackdevelopers
Popular Stack Developers Series that can help you:-
►Laravel 11 PostgreSQL Tutorial: https://www.youtube.com/playlist?list=PLLUtELdNs2ZZy4jI-wu4jYUL7rbvC8Mgh
►Laravel 10 Tutorial: https://www.youtube.com/playlist?list=PLLUtELdNs2ZbX7T5wgbBR9wUXt5YPG-hm
►Laravel Multi-Vendor E-commerce Series - https://www.youtube.com/playlist?list=PLLUtELdNs2ZYTlQ97V1Tl8mirS3qXHNFZ
►React JS Tutorial for Beginners with Laravel - https://www.youtube.com/playlist?list=PLLUtELdNs2ZYnEIWliBpU98gtorNRNHw1
►Laravel Tutorial for Beginners - https://www.youtube.com/playlist?list=PLLUtELdNs2ZaHaFmydqjcQ-YyeQ19Cd6u
►GIT Tutorial for Beginners - https://www.youtube.com/playlist?list=PLLUtELdNs2ZZVQ-dLOMFWvmCCduzJ8c6R
►Laravel API Tutorial - https://www.youtube.com/playlist?list=PLLUtELdNs2ZbcCsd4yAAiBU2L3ROREk8P
►Laravel Interview Questions - https://www.youtube.com/playlist?list=PLLUtELdNs2ZbzB_1Jdp_yFcORwOfWP8RU
►jQuery Tutorial - https://www.youtube.com/playlist?list=PLLUtELdNs2ZbMYoUA46GIonOH29KcjtxA
►Laravel Basic E-commerce Series - https://www.youtube.com/playlist?list=PLLUtELdNs2ZY5drPxIWzpq5crhantlzp7
►Laravel Dating Series - https://www.youtube.com/playlist?list=PLLUtELdNs2ZZrPUnxjlomErJfNvkyS6Hf
►Join this channel to get the complete source code of all series:
https://www.youtube.com/channel/UCExO2i-tLU1NyVZD6zOJQlw/join
Follow Stack Developers on Social Media to get updates and resolve your queries
►Like Facebook Page to get updates - http://facebook.com/stackdevelopers2/
#laravel11 #mongodb #mongodbtutorial |
Category |
Education |
Tags |
mongodb | mongo db | mongodb tutorial | mongoodb laravel tutorial | Laravel MongoDB Tutorial | Overview of MongoDB | install mongodb on windows | setup mongodb on windows | Insert data into MongoDB with Laravel | get data in laravel from mongodb | MongoDB CRUD | laravel 11 | laravel 11 tutorial | laravel 11 ecommerce | laravel 11 mongodb | php8 | laravel 10 authentication | php full course | laravel | laravel tutorial | MongoDB Tutorial | laravel 10 course for beginners | laravel multi vendor |
More Videos