46 lines
952 B
PHP
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');
|
|
}
|
|
}
|