Files
HexaHost-Panel/app/Models/WhmcsService.php
2026-05-17 13:26:14 +02:00

46 lines
952 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class WhmcsService extends Model
{
protected $fillable = [
'whmcs_service_id',
'whmcs_client_id',
'whmcs_order_id',
'customer_id',
'user_id',
'hosting_plan_id',
'status',
'config',
];
protected function casts(): array
{
return [
'whmcs_service_id' => 'integer',
'whmcs_client_id' => 'integer',
'whmcs_order_id' => 'integer',
'config' => 'array',
];
}
public function customer(): BelongsTo
{
return $this->belongsTo(Customer::class);
}
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function plan(): BelongsTo
{
return $this->belongsTo(HostingPlan::class, 'hosting_plan_id');
}
}