Transformed into pivot models and Created ResumeSlotValue
Some checks failed
linter / quality (push) Successful in 3m39s
tests / ci (push) Failing after 6m30s

This commit is contained in:
2025-08-17 11:58:55 +02:00
parent c9f499cf2d
commit 08425938d4
13 changed files with 261 additions and 10 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Models;
use App\Policies\ResumePolicy;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -25,11 +26,15 @@ class Resume extends Model
return $this->belongsTo(User::class, 'creator_id');
}
public function slots(): HasMany
{
return $this->hasMany(ResumeSlot::class);
}
public function components(): BelongsToMany
{
return $this->belongsToMany(ResumeComponent::class, 'resume_resume_component')
->withPivot('order', 'data')
->withTimestamps()
->orderBy('order');
return $this->belongsToMany(ResumeComponent::class)
->using(ResumeSlot::class)
->orderBy('resume_slots.order');
}
}