You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
544 B
25 lines
544 B
<?php
|
|
|
|
namespace App\Domains\Channel\Actions\Api;
|
|
|
|
use App\Domains\Channel\DTOs\Api\EndpointUrlDTO;
|
|
use App\Domains\Channel\Models\ApiEndpoint;
|
|
use Exception;
|
|
|
|
class AssignEndpointUrl
|
|
{
|
|
/**
|
|
* @param EndpointUrlDTO $endpoint
|
|
*
|
|
* @throws Exception
|
|
*/
|
|
public function execute(EndpointUrlDTO $endpoint): void
|
|
{
|
|
ApiEndpoint::updateOrCreate([
|
|
'key' => $endpoint->field,
|
|
], [
|
|
'client_id' => $endpoint->clientId,
|
|
'value' => $endpoint->endpointUrl,
|
|
]);
|
|
}
|
|
}
|
|
|