Files
sam-manage/app/Models/Boards/PostCustomFieldValue.php

42 lines
942 B
PHP
Raw Normal View History

<?php
namespace App\Models\Boards;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* 게시글 커스텀 필드 (EAV 저장)
*
* @property int $id
* @property int $post_id
* @property int $field_id
* @property string|null $value
*/
class PostCustomFieldValue extends Model
{
protected $table = 'post_custom_field_values';
protected $fillable = [
'post_id',
'field_id',
'value',
'created_by',
'updated_by',
];
// =========================================================================
// Relationships
// =========================================================================
public function post(): BelongsTo
{
return $this->belongsTo(Post::class, 'post_id');
}
public function field(): BelongsTo
{
return $this->belongsTo(BoardSetting::class, 'field_id');
}
}