Files
sam-api/app/Models/Boards/Post.php
hskwon cc206fdbed style: Laravel Pint 코드 포맷팅 적용
- PSR-12 스타일 가이드 준수
- 302개 파일 스타일 이슈 자동 수정
- 코드 로직 변경 없음 (포맷팅만)
2025-11-06 17:45:49 +09:00

38 lines
807 B
PHP

<?php
namespace App\Models\Boards;
use App\Models\Commons\File;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* @mixin IdeHelperPost
*/
class Post extends Model
{
use SoftDeletes;
protected $table = 'posts';
protected $fillable = [
'tenant_id', 'board_id', 'user_id', 'title', 'content', 'editor_type',
'ip_address', 'is_notice', 'is_secret', 'views', 'status',
];
public function files()
{
return $this->morphMany(File::class, 'fileable');
}
public function comments()
{
return $this->hasMany(BoardComment::class, 'post_id')->whereNull('parent_id')->where('status', 'active');
}
public function board()
{
return $this->belongsTo(Board::class, 'board_id');
}
}