- File 모델 추가 (Polymorphic 관계) - Post 모델에 files() MorphMany 관계 추가 - PostService 파일 업로드/삭제/다운로드 메서드 추가 - PostController 파일 관련 액션 추가 - 게시글 작성/수정 폼에 드래그앤드롭 파일 업로드 UI - 게시글 상세에 첨부파일 목록 표시 - tenant 디스크 설정 (공유 스토리지) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
42 lines
942 B
PHP
42 lines
942 B
PHP
<?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');
|
|
}
|
|
}
|