status == 1 ? ' Active ' : 'Inactive';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
public function childrens()
{
return $this->hasMany(Articles::class, 'parent_article');
}
public function parent()
{
return $this->belongsTo(Articles::class, 'parent_article');
}
}