canDelete

This commit is contained in:
denisdulici
2017-09-26 01:05:21 +03:00
parent e18dd406b2
commit 5c106c4fef
6 changed files with 32 additions and 48 deletions

View File

@ -85,14 +85,12 @@ class Item extends Model
{
$error = false;
$bills = $this->bills();
if ($bills->count()) {
$error['bills'] = $bills->count();
if ($bills = $this->bills()->count()) {
$error['bills'] = $bills;
}
$invoices = $this->invoices();
if ($invoices->count()) {
$error['invoices'] = $invoices->count();
if ($invoices = $this->invoices()->count()) {
$error['invoices'] = $invoices;
}
if ($error) {