Laravel Shopping Application-How to Make a Shopping Website Using Laravel Framework in 5 mins

0
89

Start Application in Shopping Cart:

Step 1:

Fresh Install Laravel Project on Your Host any kinds of Server ( Local Or Web) – To Follow Me Fresh Install

Step 2:

Setup Auth Application into your Laravel Shop. Just use Command Bellow –

Step 3: Change Configure .env file on root directory

Create Some Migration Table into Your Database. Example that –

Step 4: Update Script Using Bellow Migration :

create_table_products

create_table_files

create_table_carts

create_table_carts_item

create_table_carts_orders

create_table_order_items

Step 5:

Work on Model Environment. Example That –

Step 6:

Update Models Using Bellow Code for each Model Relation Table –

Model Product.php

Model Cart.php

Model CartItem.php

Model File_Shop.php

Model Order.php

Model OrderItem.php

Step 7:

Work on Controller Environment. Example That –

Step 8:

Update Models Using Bellow Code for each Model Relation Table –

Controller ProductController.php

@show

@yield(‘content’)

Then resource/view/main/index.blade.php

@foreach ($products as $product)

{{$product->name}}

 

 

 

{{$product->description}}

 

 

 

 

@endforeach

 

 

@endsection

Then resource/view/cart/view.blade.php

Total
@foreach($items as $item)

${{$item->product->price}}
 @endforeach

Total

${{$total}}

{!! csrf_field() !!} 

Product

 

 

@endsection Then resource/view/order/list.blade.php

Your past orders

 

 

 

Date
@foreach($orders as $order)
{{$order->created_at}}   @endforeach

Id
{{$order->id}}

 

 

@endsection

Again resource/view/order/view.blade.php

Order num : {{$order->id}}

 

Made on : {{$order->created_at}}

 

 

File
Price   @foreach($order->orderItems as $item)
{{$item->file->filename}}$ {{number_format($item->product->price,2,’,’,”)}}  @endforeach

Name
{{$item->product->name}}

 

 

@endsection