36 lines
885 B
PHP
36 lines
885 B
PHP
<?php
|
|
|
|
namespace App\Domains\Integration\Models;
|
|
|
|
use App\Domains\Client\Models\Client;
|
|
use App\Domains\Integration\Casts\EncryptedIntegrationData;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ClientIntegration extends Model
|
|
{
|
|
protected $hidden = ['integration_data'];
|
|
|
|
protected $fillable = [
|
|
'client_id',
|
|
'integration_code',
|
|
'integration_data',
|
|
];
|
|
|
|
protected $casts = [
|
|
'integration_data' => EncryptedIntegrationData::class,
|
|
];
|
|
|
|
/** @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');
|
|
}
|
|
}
|