35 lines
873 B
PHP
35 lines
873 B
PHP
<?php
|
|
|
|
namespace App\Domains\Integration\Models;
|
|
|
|
use App\Domains\Client\Models\Client;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ClientIntegration extends Model
|
|
{
|
|
protected $fillable = [
|
|
'client_id',
|
|
'integration_code',
|
|
'integration_instance_id',
|
|
];
|
|
|
|
/** @return BelongsTo<Client, $this> */
|
|
public function client(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Client::class);
|
|
}
|
|
|
|
/** @return BelongsTo<Integration, $this> */
|
|
public function integration(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Integration::class, 'integration_code', 'integration_code');
|
|
}
|
|
|
|
/** @return BelongsTo<IntegrationInstance, $this> */
|
|
public function integrationInstance(): BelongsTo
|
|
{
|
|
return $this->belongsTo(IntegrationInstance::class);
|
|
}
|
|
}
|