Add Prop and ModelPropValue models with relationships; create migration files for props, prop options, prop data types, and model prop values
This commit is contained in:
27
app/Domains/Prop/Models/PropOption.php
Normal file
27
app/Domains/Prop/Models/PropOption.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domains\Prop\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
#[Fillable([
|
||||
'prop_id',
|
||||
'value',
|
||||
'label',
|
||||
'sort_order',
|
||||
])]
|
||||
class PropOption extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* @return BelongsTo<Prop, $this>
|
||||
*/
|
||||
public function prop(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Prop::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user