diff --git a/app/Http/Controllers/ProductController.php b/app/Http/Controllers/ProductController.php index ea6f9b3dc3..930730f9e5 100644 --- a/app/Http/Controllers/ProductController.php +++ b/app/Http/Controllers/ProductController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers; use App\Http\Requests\CreateProductRequest; +use App\Http\Requests\UpdateProductRequest; use App\Http\Requests\ProductRequest; use App\Models\Product; use App\Models\TaxRate; diff --git a/resources/views/accounts/product.blade.php b/resources/views/accounts/product.blade.php index 72d253082e..9c286ca1d3 100644 --- a/resources/views/accounts/product.blade.php +++ b/resources/views/accounts/product.blade.php @@ -60,7 +60,8 @@ @endif @endforeach - @if((!$product && Auth::user()->can('create', ENTITY_PRODUCT)) || ($product && Auth::user()->can('edit',[ENTITY_PRODUCT, $product]))) + + @if (Auth::user()->canCreateOrEdit(ENTITY_PRODUCT, $product))
{!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(HTMLUtils::previousUrl('/products'))->appendIcon(Icon::create('remove-circle')) !!} {!! Button::success(trans('texts.save'))->submit()->large()->appendIcon(Icon::create('floppy-disk')) !!}