From d4d160938d6a6ce180686cde9a3fde024fe30218 Mon Sep 17 00:00:00 2001 From: Jordi Fernandez Date: Wed, 5 Jul 2023 13:11:03 +0200 Subject: [PATCH] Changed edit blade to support creations --- src/resources/views/edit.blade.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/resources/views/edit.blade.php b/src/resources/views/edit.blade.php index 5f2b52d0..bdfe33dc 100644 --- a/src/resources/views/edit.blade.php +++ b/src/resources/views/edit.blade.php @@ -23,11 +23,14 @@ @includeWhen($multiple, 'thrust::quantityInput') - @if (app(BadChoice\Thrust\ResourceGate::class)->can($resourceName, 'update', $object)) - @include('thrust::components.saveButton', ["updateConfirmationMessage" => $updateConfirmationMessage]) - - @if (isset($object->id) ) - + @if (isset($object->id)) + @if (app(BadChoice\Thrust\ResourceGate::class)->can($resourceName, 'update', $object)) + @include('thrust::components.saveButton', ["updateConfirmationMessage" => $updateConfirmationMessage]) + + @endif + @else + @if (app(BadChoice\Thrust\ResourceGate::class)->can($resourceName, 'create', $object)) + @include('thrust::components.saveButton', ["updateConfirmationMessage" => $updateConfirmationMessage]) @endif @endif