Загрузка...

#88 Make E-com in Laravel 5.6 / 5.7 | Work on Admin Panel | View Orders

In Part-88, we are going to resolve one issue that is coming when one user logout and another user login and found the first user products in cart. Also, we are going to show orders in admin panel as well so that admin can check and process the orders.

1) Update logout function :-

We need to update logout function in UsersController file and forget session_id like below :-

Session::forget('session_id');

2) Update admin_sidebar.blade.php

Update admin_sidebar.blade.php file with View Orders link as shown in video.

3) Create "view-orders" Route :-

Create GET Route for "view-orders" in web.php file with Admin routes like below :-

Route::get('/admin/view-orders','ProductsController@viewOrders');

4) Create viewOrders function :-

Create viewOrders function in ProductsController file that will return to view_orders blade file.

5) Create view_orders.blade.php file :-

Create orders folder under admin folder and then create view_orders.blade.php file under orders folder.

6) Update viewOrders function :-

Now update viewOrders function that we have created earlier to get all the orders that we will return to view orders blade file.

7) Update view_orders.blade.php file :-

Copy content from view_products.blade.php file and then make changes in view_orders.blade.php file to display all the orders in foreach loop.

Now all the orders are displayed in admin panel. In next video, we will show complete order details in admin panel.

Stay tune for next video. Thanks for watching :)

Видео #88 Make E-com in Laravel 5.6 / 5.7 | Work on Admin Panel | View Orders канала Stack Developers
Страницу в закладки Мои закладки
Все заметки Новая заметка Страницу в заметки

На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.

Об использовании CookiesПринять