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

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