attributes['link_logo'])) { $up_file = null; } else { $up_file = $this->attributes['link_logo']; } return $up_file; } public function getLogoUrlAttribute() { $url = null; if (preg_match('/^http/', $this->attributes['link_logo'])) { $url = $this->attributes['link_logo']; } return $url; } public function show_category() { return $this->belongsTo(LinkCategory::class, 'type_id'); } public function subsites() { return $this->hasMany(SubsiteLink::class, 'link_id'); } }