In this video we are going to learn about Show Orders in Admin Panel.
So let see how can we can we show orders in admin panel.
So first of all lets create a component for Orders
So switch to the command prompt and lets create the new livewire component.
So just run the command.

php artisan make:livewire admin/AdminOrderComponent

Now run the application

php artisan serve

And switch to project and now lets create the route for this component
So go inside the routes directory and then open web.php file.
Inside the admin middleware group route


Alright now lets open the AdminOrderComponent.php class file write the following code.


namespace App\\Http\\Livewire\\Admin;

use App\\Models\\Order;
use Livewire\\Component;

class AdminOrderComponent extends Component
public function render()
$orders = Order::orderBy('created_at','DESC')->paginate(12);
return view('livewire.admin.admin-order-component',['orders'=>$orders])->layout('layouts.base');

Allright now open the admin-order-component.blade.php view file and the following code.

nav svg{
height: 20px;
nav .hidden{
display: block !important;

<div class=\"container\" style=\"padding: 30px 0;\">
<div class=\"row\">
<div class=\"col-md-12\">
<div class=\"panel panel-default\">
<div class=\"panel-heading\">
All Orders
<div class=\"panel-body\">
<div class=\"alert alert-success\" role=\"alert\">{{Session::get('order_message')}}</div>
<table class=\"table table-striped\">
<th>First Name</th>
<th>Last Name</th>
<th>Order Date</th>
<th colspan=\"2\" class=\"text-center\">Action</th>
@foreach ($orders as $order)
<td><a href=\"{{route('admin.orderdetails',['order_id'=>$order->id])}}\" class=\"btn btn-info btn-sm\">Details</a></td>

Now open the base.blade.php layout file
lets add here the link for orders inside the admin menu.

<li class=\"menu-item\">
<a title=\"All Orders\" href=\"{{route('admin.orders')}}\">All Orders</a>

Now its done so lets check it.
So switch to the browser and refresh the page.
No go inside the admin menu and here you will see the All Orders link.
Now just click on this link.
And here you will see all orders.
So in this way you can show orders in admin panel.