- Added `ConnectionStatusData` DTO and `ConnectionStatusService` for managing connection statuses with mapped enums. - Updated `ConnectedAppFactory` and Livewire `StoreConnectedAppForm` to integrate `ConnectionStatusData` and remove `logoUrl` field. - Adjusted `ConnectedApp` model to rename columns for consistency. - Implemented error handling in `ConnectedAppService::create()` for improved resilience. - Updated Blade templates and composer dependencies for compatibility.
27 lines
500 B
PHP
27 lines
500 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Services;
|
|
|
|
use App\Data\ConnectedApp\ConnectAppRequest;
|
|
use App\Models\ConnectedApp;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Throwable;
|
|
|
|
final class ConnectedAppService
|
|
{
|
|
/**
|
|
* Create a new connected app.
|
|
* @throws Throwable
|
|
*/
|
|
public function create(ConnectAppRequest $data): void
|
|
{
|
|
DB::transaction(
|
|
fn () => ConnectedApp::query()->create(
|
|
$data->toArray()
|
|
)
|
|
);
|
|
}
|
|
}
|