Migration move media table and fixed attribute issue
This commit is contained in:
@@ -89,6 +89,10 @@ class User extends Authenticatable
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($value)) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
if (!$this->hasMedia('picture')) {
|
||||
return false;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user