- EsignFieldTemplate, EsignFieldTemplateItem 모델 추가 - EsignApiController에 템플릿 CRUD + 적용/복사 메서드 5개 추가 - web.php에 템플릿 라우트 5개 추가 - fields.blade.php에 템플릿 드롭다운 메뉴 + 모달 3개 추가 (SaveTemplate, LoadTemplate, CopyFromContract) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
42 lines
938 B
PHP
42 lines
938 B
PHP
<?php
|
|
|
|
namespace App\Models\ESign;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class EsignFieldTemplate extends Model
|
|
{
|
|
protected $table = 'esign_field_templates';
|
|
|
|
protected $fillable = [
|
|
'tenant_id',
|
|
'name',
|
|
'description',
|
|
'signer_count',
|
|
'is_active',
|
|
'created_by',
|
|
];
|
|
|
|
protected $casts = [
|
|
'signer_count' => 'integer',
|
|
'is_active' => 'boolean',
|
|
];
|
|
|
|
public function scopeForTenant($query, $tenantId)
|
|
{
|
|
return $query->where('tenant_id', $tenantId);
|
|
}
|
|
|
|
public function items(): HasMany
|
|
{
|
|
return $this->hasMany(EsignFieldTemplateItem::class, 'template_id')->orderBy('sort_order');
|
|
}
|
|
|
|
public function creator(): BelongsTo
|
|
{
|
|
return $this->belongsTo(\App\Models\User::class, 'created_by');
|
|
}
|
|
}
|