33 lines
1 KiB
PHP
33 lines
1 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', "Sklep")
|
|
|
|
@section('main')
|
|
<p>
|
|
<b>Welcome, you are logged in as {{ $user->name }}</b>
|
|
</p>
|
|
<p>
|
|
<a href="/logout"> Logout </a>
|
|
</p>
|
|
<div>
|
|
<h2>Your cart:</h2>
|
|
<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>
|
|
@foreach($user->cart as $product)
|
|
<div>
|
|
<x-product :product="$product" />
|
|
</div>
|
|
<form action="{{ route("removeFromCart", $product) }}" method="post">
|
|
@csrf
|
|
<button type="submit"> Remove from cart </button>
|
|
</form>
|
|
@endforeach()
|
|
</div>
|
|
</div>
|
|
@endsection()
|