2021-12-08 00:29:02 +01:00
|
|
|
@push('head')
|
|
|
|
<link rel="stylesheet" href="{{ mix("css/user.css") }}">
|
|
|
|
@endpush
|
|
|
|
|
2021-12-05 19:23:42 +01:00
|
|
|
@extends('layouts.app')
|
|
|
|
|
|
|
|
@section('title', "Sklep")
|
|
|
|
|
|
|
|
@section('main')
|
2021-09-05 02:22:17 +02:00
|
|
|
<p>
|
2021-12-05 19:23:42 +01:00
|
|
|
<b>Welcome, you are logged in as {{ $user->name }}</b>
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<a href="/logout"> Logout </a>
|
2021-09-05 02:22:17 +02:00
|
|
|
</p>
|
2021-11-19 08:04:04 +01:00
|
|
|
<div>
|
|
|
|
<h2>Your cart:</h2>
|
2021-12-05 19:23:42 +01:00
|
|
|
<div>
|
2021-12-08 00:29:02 +01:00
|
|
|
<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>
|
|
|
|
|
2021-12-07 12:22:46 +01:00
|
|
|
<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>
|
2021-12-05 19:23:42 +01:00
|
|
|
</div>
|
2021-11-19 08:04:04 +01:00
|
|
|
</div>
|
2021-12-05 19:23:42 +01:00
|
|
|
@endsection()
|