shareit/resources/views/product/buttons.blade.php
Bruno Fontes 6236c0c9fe
Refactoring product view
Creating a separate buttons file to edit or delete a product
2018-09-12 21:28:39 -03:00

22 lines
648 B
PHP

<span class="d-inline-block text-truncat float-right">
<div class="btn-group btn-group-sm" role="group">
<!-- EDIT BUTTON -->
@if ($product->user_id == \Auth::id())
<form action="/product/{{$product->id}}" method="POST">
@method('PATCH')
<button type="button" class="btn-sm btn-secondary mr-1">Edit</button>
</form>
@endif
<!-- DELETE BUTTON -->
<form action="/product/{{$product->id}}" method="POST">
@method('DELETE')
<button type="button" class="btn-sm btn-danger">Delete</button>
</form>
</div>
</span>