Models refactor + Basic functionnalities
This commit is contained in:
@@ -16,30 +16,24 @@ class ResumeComponent extends Model
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'vue_component_name',
|
||||
];
|
||||
|
||||
public function resumes(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Resume::class, 'resume_resume_component')
|
||||
->using(ResumeSlot::class)
|
||||
->withTimestamps();
|
||||
return $this->belongsToMany(Resume::class)
|
||||
->using(ResumeComponentData::class);
|
||||
}
|
||||
|
||||
public function slots(): HasMany
|
||||
public function data(): HasMany
|
||||
{
|
||||
return $this->hasMany(ResumeSlot::class);
|
||||
return $this->hasMany(ResumeComponentData::class);
|
||||
}
|
||||
|
||||
public function inputs(): HasMany
|
||||
public function placements(): BelongsToMany
|
||||
{
|
||||
return $this->hasMany(ResumeComponentInput::class);
|
||||
}
|
||||
|
||||
public function dataTypes(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(ResumeComponentDataType::class)
|
||||
->using(ResumeComponentInput::class)
|
||||
->withTimestamps();
|
||||
return $this->belongsToMany(ResumeComponentPlacement::class)
|
||||
->using(ResumeComponentData::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user