Files
sam-api/app/Models/MainRequestFlow.php

48 lines
1.0 KiB
PHP
Raw Normal View History

<?php
namespace App\Models;
2025-07-29 17:20:44 +09:00
use App\Models\MainRequest;
use Illuminate\Database\Eloquent\Model;
2025-07-29 17:20:44 +09:00
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphTo;
/**
* @mixin IdeHelperMainRequestFlow
*/
class MainRequestFlow extends Model
{
/**
* 업무 전체/상세 흐름 이력(폴리모픽)
*/
protected $table = 'main_request_flows';
protected $fillable = [
'main_request_id',
'flowable_type', // 폴리모픽 타입(모델명)
'flowable_id', // 폴리모픽 PK
'status_code',
'action',
'content',
'actor_id',
'created_at',
'updated_at',
];
/**
* 메인 업무 엔터티
*/
2025-07-29 17:20:44 +09:00
public function mainRequest(): BelongsTo
{
return $this->belongsTo(MainRequest::class, 'main_request_id');
}
/**
* 폴리모픽 관계(견적, 주문, 발주 )
*/
2025-07-29 17:20:44 +09:00
public function flowable(): MorphTo
{
return $this->morphTo();
}
}