From 73e8b5e4b48c0952ef3ea758b1fad3f6e59f0765 Mon Sep 17 00:00:00 2001 From: Bruno Fontes Date: Wed, 12 Sep 2018 21:28:39 -0300 Subject: [PATCH] Refactoring product view Creating a separate buttons file to edit or delete a product --- resources/views/product/buttons.blade.php | 22 ++++++++++++++++++++++ resources/views/product/show.blade.php | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 resources/views/product/buttons.blade.php diff --git a/resources/views/product/buttons.blade.php b/resources/views/product/buttons.blade.php new file mode 100644 index 0000000..762700a --- /dev/null +++ b/resources/views/product/buttons.blade.php @@ -0,0 +1,22 @@ + +
+ + + + @if ($product->user_id == \Auth::id()) +
+ @method('PATCH') + +
+ @endif + + + +
+ @method('DELETE') + +
+ + +
+
\ No newline at end of file diff --git a/resources/views/product/show.blade.php b/resources/views/product/show.blade.php index b1d43df..473bc00 100644 --- a/resources/views/product/show.blade.php +++ b/resources/views/product/show.blade.php @@ -19,7 +19,7 @@
Product: {{$product['name']}} - Edit - Delete + @include ('product.buttons')
@@ -28,6 +28,7 @@
@endif + Items: