diff --git a/app/Models/Resume.php b/app/Models/Resume.php index a75eb21..3d3b5fc 100644 --- a/app/Models/Resume.php +++ b/app/Models/Resume.php @@ -27,6 +27,9 @@ class Resume extends Model public function components(): BelongsToMany { - return $this->belongsToMany(ResumeComponent::class, 'resume_resume_component')->withPivot('order')->withTimestamps()->orderBy('order'); + return $this->belongsToMany(ResumeComponent::class, 'resume_resume_component') + ->withPivot('order', 'data') + ->withTimestamps() + ->orderBy('order'); } } diff --git a/app/Models/ResumeComponent.php b/app/Models/ResumeComponent.php index 91a2eae..8ad1e4b 100644 --- a/app/Models/ResumeComponent.php +++ b/app/Models/ResumeComponent.php @@ -20,6 +20,8 @@ class ResumeComponent extends Model public function resumes(): BelongsToMany { - return $this->belongsToMany(Resume::class, 'resume_resume_component')->withPivot('order')->withTimestamps(); + return $this->belongsToMany(Resume::class, 'resume_resume_component') + ->withPivot('order', 'data') + ->withTimestamps(); } } diff --git a/database/migrations/2025_08_16_112542_create_resume_resume_component_link.php b/database/migrations/2025_08_16_112542_create_resume_resume_component_link.php index 5f7c8e6..19f79a7 100644 --- a/database/migrations/2025_08_16_112542_create_resume_resume_component_link.php +++ b/database/migrations/2025_08_16_112542_create_resume_resume_component_link.php @@ -21,6 +21,8 @@ return new class extends Migration $table->integer('order')->default(0); + $table->json('data')->comment('JSON structure to define the data for the resume component'); + $table->timestamps(); }); }