pai-sklep/resources/views/user.blade.php
2021-12-05 22:01:53 +01:00

26 lines
670 B
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>
@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()