30 lines
599 B
PHP
30 lines
599 B
PHP
<?php
|
|
|
|
namespace App\Domains\Catalog\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
|
|
|
class GroupItem extends Model
|
|
{
|
|
protected $table = 'group_items';
|
|
|
|
protected $fillable = [
|
|
'featured_group_id',
|
|
'groupable_type',
|
|
'groupable_id',
|
|
'order',
|
|
];
|
|
|
|
public function featuredGroup(): BelongsTo
|
|
{
|
|
return $this->belongsTo(FeaturedGroup::class);
|
|
}
|
|
|
|
public function groupable(): MorphTo
|
|
{
|
|
return $this->morphTo();
|
|
}
|
|
}
|