Add reusable project templates

This commit is contained in:
2026-05-25 01:26:08 +00:00
parent 3b17c9ee14
commit 58d2edcacd
24 changed files with 1154 additions and 88 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace App\Models;
use Database\Factories\ProjectTemplateFactory;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
#[Fillable(['source_project_id', 'name', 'slug', 'copy_areas', 'configuration_snapshot'])]
class ProjectTemplate extends Model
{
/** @use HasFactory<ProjectTemplateFactory> */
use HasFactory;
protected function casts(): array
{
return [
'copy_areas' => 'array',
'configuration_snapshot' => 'array',
];
}
public function sourceProject(): BelongsTo
{
return $this->belongsTo(Project::class, 'source_project_id');
}
}