refs #164 models update

This commit is contained in:
Cüneyt Şentürk
2018-01-10 18:21:12 +03:00
parent e65743c7c3
commit 87b327d9b8
11 changed files with 70 additions and 48 deletions

View File

@ -88,11 +88,9 @@ class User extends Authenticatable
}
}
if (!empty($value)) {
if (!empty($value) && !$this->hasMedia('picture')) {
return $value;
}
if (!$this->hasMedia('picture')) {
} elseif (!$this->hasMedia('picture')) {
return false;
}

View File

@ -238,11 +238,9 @@ class Company extends Eloquent
*/
public function getCompanyLogoAttribute($value)
{
if (!empty($value)) {
if (!empty($value) && !$this->hasMedia('company_logo')) {
return $value;
}
if (!$this->hasMedia('company_logo')) {
} elseif (!$this->hasMedia('company_logo')) {
return false;
}

View File

@ -137,11 +137,9 @@ class Bill extends Model
*/
public function getAttachmentAttribute($value)
{
if (!empty($value)) {
if (!empty($value) && !$this->hasMedia('attachment')) {
return $value;
}
if (!$this->hasMedia('attachment')) {
} elseif (!$this->hasMedia('attachment')) {
return false;
}

View File

@ -87,11 +87,9 @@ class BillPayment extends Model
*/
public function getAttachmentAttribute($value)
{
if (!empty($value)) {
if (!empty($value) && !$this->hasMedia('attachment')) {
return $value;
}
if (!$this->hasMedia('attachment')) {
} elseif (!$this->hasMedia('attachment')) {
return false;
}

View File

@ -100,11 +100,9 @@ class Payment extends Model
*/
public function getAttachmentAttribute($value)
{
if (!empty($value)) {
if (!empty($value) && !$this->hasMedia('attachment')) {
return $value;
}
if (!$this->hasMedia('attachment')) {
} elseif (!$this->hasMedia('attachment')) {
return false;
}

View File

@ -146,11 +146,9 @@ class Invoice extends Model
*/
public function getAttachmentAttribute($value)
{
if (!empty($value)) {
if (!empty($value) && !$this->hasMedia('attachment')) {
return $value;
}
if (!$this->hasMedia('attachment')) {
} elseif (!$this->hasMedia('attachment')) {
return false;
}

View File

@ -87,11 +87,9 @@ class InvoicePayment extends Model
*/
public function getAttachmentAttribute($value)
{
if (!empty($value)) {
if (!empty($value) && !$this->hasMedia('attachment')) {
return $value;
}
if (!$this->hasMedia('attachment')) {
} elseif (!$this->hasMedia('attachment')) {
return false;
}

View File

@ -106,11 +106,9 @@ class Revenue extends Model
*/
public function getAttachmentAttribute($value)
{
if (!empty($value)) {
if (!empty($value) && !$this->hasMedia('attachment')) {
return $value;
}
if (!$this->hasMedia('attachment')) {
} elseif (!$this->hasMedia('attachment')) {
return false;
}

View File

@ -120,11 +120,9 @@ class Item extends Model
*/
public function getPictureAttribute($value)
{
if (!empty($value)) {
if (!empty($value) && !$this->hasMedia('picture')) {
return $value;
}
if (!$this->hasMedia('picture')) {
} elseif (!$this->hasMedia('picture')) {
return false;
}

View File

@ -10,6 +10,8 @@ class Setting extends Model
protected $table = 'settings';
public $timestamps = false;
/**
* Attributes that should be mass-assignable.
*