29 lines
513 B
PHP
29 lines
513 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||
|
|
|
||
|
|
class AttachmentForm extends Model
|
||
|
|
{
|
||
|
|
use SoftDeletes;
|
||
|
|
|
||
|
|
protected $table = 'attachment_form';
|
||
|
|
|
||
|
|
protected $fillable = [
|
||
|
|
'form_id',
|
||
|
|
'table_name',
|
||
|
|
'file_category',
|
||
|
|
'file_path',
|
||
|
|
];
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Relasi dinamis ke table form terkait
|
||
|
|
*/
|
||
|
|
public function form()
|
||
|
|
{
|
||
|
|
return $this->morphTo(__FUNCTION__, 'table_name', 'form_id');
|
||
|
|
}
|
||
|
|
}
|