Models refactor + Basic functionnalities
This commit is contained in:
@@ -26,15 +26,13 @@ class Resume extends Model
|
||||
return $this->belongsTo(User::class, 'creator_id');
|
||||
}
|
||||
|
||||
public function slots(): HasMany
|
||||
public function componentsPlacements(): HasMany
|
||||
{
|
||||
return $this->hasMany(ResumeSlot::class);
|
||||
return $this->hasMany(ResumeComponentPlacement::class);
|
||||
}
|
||||
|
||||
public function components(): BelongsToMany
|
||||
public function componentsData()
|
||||
{
|
||||
return $this->belongsToMany(ResumeComponent::class)
|
||||
->using(ResumeSlot::class)
|
||||
->orderBy('resume_slots.order');
|
||||
return $this->hasManyThrough(ResumeComponentData::class, ResumeComponentPlacement::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user