- Introduced a Livewire-powered confirmation modal for deleting connection providers. - Updated `delete` method to support selected provider deletion and modal interaction. - Added `connectedApps` relationship to `ConnectionProvider` model for mass soft-deletes. - Refactored delete logic to handle associated connected apps during provider deletion. - Updated UI to include modal trigger and actions for enhanced user safety.
37 lines
842 B
PHP
37 lines
842 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\{Model, Relations\BelongsTo, SoftDeletes};
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
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(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ConnectionProvider::class, 'connection_provider_id');
|
|
}
|
|
|
|
public function status(): HasOne
|
|
{
|
|
return $this->hasOne(ConnectionStatus::class, 'id', 'connection_status_id');
|
|
}
|
|
}
|