38 lines
743 B
PHP
38 lines
743 B
PHP
<?php
|
|
|
|
namespace Modules\Service\app\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Service extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*/
|
|
protected $fillable = [
|
|
'uuid',
|
|
'title',
|
|
'summary',
|
|
'detail',
|
|
'image',
|
|
'image_path',
|
|
'status',
|
|
'slug',
|
|
// 'homepage_flag',
|
|
];
|
|
|
|
public function serviceMeta()
|
|
{
|
|
return $this->hasOne(ServiceMeta::class, 'service_id');
|
|
}
|
|
|
|
public function getFullImageAttribute()
|
|
{
|
|
return $this->image_path ? asset('storage/uploads/'.$this->image_path) : asset('source/images/default.jpg');
|
|
}
|
|
|
|
}
|