55 lines
1.0 KiB
PHP
55 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Modules\Package\app\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Modules\CountryList\app\Models\Country;
|
|
use Modules\Package\Database\factories\PackageFactory;
|
|
|
|
class Package extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*/
|
|
protected $fillable = [
|
|
'uuid',
|
|
'country_id',
|
|
'title',
|
|
'description',
|
|
'price',
|
|
'duration',
|
|
'group_size',
|
|
'ordering',
|
|
'image',
|
|
'image_path',
|
|
'status',
|
|
];
|
|
|
|
public function country()
|
|
{
|
|
return $this->belongsTo(Country::class);
|
|
}
|
|
|
|
protected static function newFactory(): PackageFactory
|
|
{
|
|
//return PackageFactory::new();
|
|
}
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public function getFullImageAttribute()
|
|
{
|
|
$result = null;
|
|
|
|
if($this->image_path) {
|
|
$result = asset('storage/uploads/' . $this->image_path);
|
|
}
|
|
|
|
return $result;
|
|
}
|
|
}
|