-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Nova actions to create the missing clients and consumers
- Loading branch information
1 parent
bc751f8
commit 4e1e7c9
Showing
3 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Nova\Actions\Auth0; | ||
|
||
use App\Auth0\Jobs\CreateMissingClients as CreateMissingAuth0ClientsJob; | ||
use App\Domain\Integrations\Models\IntegrationModel; | ||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Queue\InteractsWithQueue; | ||
use Illuminate\Support\Facades\Event; | ||
use Laravel\Nova\Actions\Action; | ||
use Laravel\Nova\Actions\ActionModelCollection; | ||
use Laravel\Nova\Fields\ActionFields; | ||
use Ramsey\Uuid\Uuid; | ||
|
||
final class CreateMissingAuth0Clients extends Action | ||
{ | ||
use InteractsWithQueue; | ||
use Queueable; | ||
|
||
public function __construct() | ||
{ | ||
} | ||
|
||
public function handle(ActionFields $fields, ActionModelCollection $actionModelCollection): void | ||
{ | ||
foreach ($actionModelCollection as $integrationModel) { | ||
if (!$integrationModel instanceof IntegrationModel) { | ||
continue; | ||
} | ||
|
||
Event::dispatch(new CreateMissingAuth0ClientsJob(Uuid::fromString($integrationModel->id))); | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
app/Nova/Actions/UiTiDv1/CreateMissingUiTiDv1Consumers.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Nova\Actions\UiTiDv1; | ||
|
||
use App\Domain\Integrations\Models\IntegrationModel; | ||
use App\UiTiDv1\Jobs\CreateMissingConsumers as CreateMissingUiTiDv1ConsumersJob; | ||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Queue\InteractsWithQueue; | ||
use Illuminate\Support\Facades\Event; | ||
use Laravel\Nova\Actions\Action; | ||
use Laravel\Nova\Actions\ActionModelCollection; | ||
use Laravel\Nova\Fields\ActionFields; | ||
use Ramsey\Uuid\Uuid; | ||
|
||
final class CreateMissingUiTiDv1Consumers extends Action | ||
{ | ||
use InteractsWithQueue; | ||
use Queueable; | ||
|
||
public function __construct() | ||
{ | ||
} | ||
|
||
public function handle(ActionFields $fields, ActionModelCollection $actionModelCollection): void | ||
{ | ||
foreach ($actionModelCollection as $integrationModel) { | ||
if (!$integrationModel instanceof IntegrationModel) { | ||
continue; | ||
} | ||
|
||
Event::dispatch(new CreateMissingUiTiDv1ConsumersJob(Uuid::fromString($integrationModel->id))); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters