In this video we are going to learn about how to create Product.
So let see how can we create product page.
First of all create new Livewire Component.
So switch to the command prompt and for creating new livewire component run the command.

php artisan make:livewire admin/AdminProductComponent

Now switch to the project and lets create the route for this AdminProductComponent So to go the web.php and here inside the admin route group create the route.


Now open the AdminProductCompoent.php class file and write the following code.


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

use App\\Models\\Product;
use Livewire\\Component;
use Livewire\\WithPagination;

class AdminProductComponent extends Component
use WithPagination;

public function render()
$products = Product::paginate(10);
return view('livewire.admin.admin-product-component',['products'=>$products])->layout('layouts.base');

Now open the admin-product-component.blade.php view file write 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\">
<div class=\"row\">
<div class=\"col-md-6\">
All Products
<div class=\"col-md-6\">
<a href=\"#\" class=\"btn btn-success pull-right\">Add New</a>
<div class=\"panel-body\">
<div class=\"alert alert-success\" role=\"alert\">{{Session::get('message')}}</div>
<table class=\"table table-striped\">
<th>Sale Price</th>
@foreach ($products as $product)
<td><img src=\"{{asset('assets/images/products')}}/{{$product->image}}\" width=\"60\" /></td>

now lets add the link for all products inside the admin menu.
So open the base layout file.
And inside this admin menu add the link.

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

Now its done so lets check it.
Switch to browser and refresh the page.
And here inside the admin menu you can see the All Products Link.
Now click on this link.
Here you can see the all products with pagination.
10 records are showing here.
If I click on next link you can see another 10 records.
So in this way you can create product page in laravel 8 ecommerce.