pai-sklep/resources/views/cart.blade.php
2021-12-08 16:39:56 +01:00

34 lines
1.1 KiB
PHP

@push('head')
<link rel="stylesheet" href="{{ mix("css/user.css") }}">
@endpush
@extends('layouts.app')
@section('title', "Sklep")
@section('main')
<div>
<h2>Your cart:</h2>
<div>
<div class="cart-items">
@foreach($user->cart as $product)
<div class="cart-item">
<x-product :product="$product" />
<form class="remove-cart-form" action="{{ route("removeFromCart", $product) }}" method="post">
@csrf
<button type="submit"> Remove from cart </button>
</form>
</div>
@endforeach()
</div>
<form action="{{ route("order.create") }}" method="post">
@csrf
@foreach($user->cart as $product)
<input type="hidden" name="products[{{ $loop->index }}]" value="{{ $product->uuid }}">
@endforeach()
<button type="submit"> Order </button>
</form>
</div>
</div>
@endsection()