pai-sklep/resources/views/user.blade.php

29 lines
681 B
PHP
Raw Normal View History

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-11-19 08:04:04 +01:00
@foreach($user->cart as $product)
2021-12-05 19:23:42 +01:00
<div>
<x-product :product="$product" />
</div>
<form action="{{ route("removeFromCart", $product) }}" method="post">
@csrf
<button type="submit"> Remove from cart </a>
</form>
2021-11-19 08:04:04 +01:00
@endforeach()
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()
2021-09-05 02:22:17 +02:00
</body>
</html>