initial commit
This commit is contained in:
45
app/Models/WhmcsService.php
Normal file
45
app/Models/WhmcsService.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user