Transformed into pivot models and Created ResumeSlotValue
This commit is contained in:
@@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Attributes\UsePolicy;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
#[UsePolicy(ResumeComponentPolicy::class)]
|
||||
class ResumeComponent extends Model
|
||||
@@ -21,7 +22,24 @@ class ResumeComponent extends Model
|
||||
public function resumes(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Resume::class, 'resume_resume_component')
|
||||
->withPivot('order', 'data')
|
||||
->using(ResumeSlot::class)
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
public function slots(): HasMany
|
||||
{
|
||||
return $this->hasMany(ResumeSlot::class);
|
||||
}
|
||||
|
||||
public function inputs(): HasMany
|
||||
{
|
||||
return $this->hasMany(ResumeComponentInput::class);
|
||||
}
|
||||
|
||||
public function dataTypes(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(ResumeComponentDataType::class)
|
||||
->using(ResumeComponentInput::class)
|
||||
->withTimestamps();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user