Added the data to the Resume <-> Resume Component relationship
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user