Migration move media table and fixed attribute issue

This commit is contained in:
cuneytsenturk
2018-01-03 20:08:56 +03:00
parent 3c15d3e96f
commit 5788233c2e
10 changed files with 72 additions and 8 deletions

View File

@@ -89,6 +89,10 @@ class User extends Authenticatable
}
}
if (!empty($value)) {
return $value;
}
if (!$this->hasMedia('picture')) {
return false;
}

View File

@@ -236,8 +236,12 @@ class Company extends Eloquent
*
* @return string
*/
public function getCompanyLogoAttribute()
public function getCompanyLogoAttribute($value)
{
if (!empty($value)) {
return $value;
}
if (!$this->hasMedia('company_logo')) {
return false;
}

View File

@@ -135,8 +135,12 @@ class Bill extends Model
*
* @return string
*/
public function getAttachmentAttribute()
public function getAttachmentAttribute($value)
{
if (!empty($value)) {
return $value;
}
if (!$this->hasMedia('attachment')) {
return false;
}

View File

@@ -85,8 +85,12 @@ class BillPayment extends Model
*
* @return string
*/
public function getAttachmentAttribute()
public function getAttachmentAttribute($value)
{
if (!empty($value)) {
return $value;
}
if (!$this->hasMedia('attachment')) {
return false;
}

View File

@@ -98,8 +98,12 @@ class Payment extends Model
*
* @return string
*/
public function getAttachmentAttribute()
public function getAttachmentAttribute($value)
{
if (!empty($value)) {
return $value;
}
if (!$this->hasMedia('attachment')) {
return false;
}

View File

@@ -144,8 +144,12 @@ class Invoice extends Model
*
* @return string
*/
public function getAttachmentAttribute()
public function getAttachmentAttribute($value)
{
if (!empty($value)) {
return $value;
}
if (!$this->hasMedia('attachment')) {
return false;
}

View File

@@ -85,8 +85,12 @@ class InvoicePayment extends Model
*
* @return string
*/
public function getAttachmentAttribute()
public function getAttachmentAttribute($value)
{
if (!empty($value)) {
return $value;
}
if (!$this->hasMedia('attachment')) {
return false;
}

View File

@@ -104,8 +104,12 @@ class Revenue extends Model
*
* @return string
*/
public function getAttachmentAttribute()
public function getAttachmentAttribute($value)
{
if (!empty($value)) {
return $value;
}
if (!$this->hasMedia('attachment')) {
return false;
}

View File

@@ -118,8 +118,12 @@ class Item extends Model
*
* @return string
*/
public function getPictureAttribute()
public function getPictureAttribute($value)
{
if (!empty($value)) {
return $value;
}
if (!$this->hasMedia('picture')) {
return false;
}