- Renamed models, migration files, and database tables for greater consistency (e.g., `service_protocols` to `connection_protocols`, `service_providers` to `connection_providers`). - Enabled `SoftDeletes` trait on core models, including `User`, `ConnectionProvider`, `ConnectedApp`, and others. - Updated migration schemas to include `softDeletes()` and adjusted `down()` methods accordingly. - Enhanced indexing in `connected_apps` to optimize query performance.
37 lines
821 B
PHP
37 lines
821 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\{Model, SoftDeletes};
|
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
|
|
|
#[Fillable([
|
|
'name',
|
|
'slug',
|
|
'connection_protocol_id',
|
|
'connection_provider_id',
|
|
'connection_status_id',
|
|
])]
|
|
class ConnectedApp extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
public function protocol(): HasOne
|
|
{
|
|
return $this->hasOne(ConnectionProtocol::class, 'id', 'connection_protocol_id');
|
|
}
|
|
|
|
public function provider(): HasOne
|
|
{
|
|
return $this->hasOne(ConnectionProvider::class, 'id', 'connection_provider_id');
|
|
}
|
|
|
|
public function status(): HasOne
|
|
{
|
|
return $this->hasOne(ConnectionStatus::class, 'id', 'connection_status_id');
|
|
}
|
|
}
|