belongsTo(\App\Models\OsGroup::class); } public function getStatus() { return match ($this->attributes['status']){ 1 => 'Active', default => 'De-Active' }; } /** * Many-to-many relationship với VPS products. */ public function vpsProducts() { return $this->belongsToMany(\App\Models\VPS::class, 'product_os', 'os_id', 'product_id') ->withTimestamps() ->withPivot('product_type'); } }