refactor applicationdeploymentjob
This commit is contained in:
27
app/Providers/ApplicationDeploymentFinished.php
Normal file
27
app/Providers/ApplicationDeploymentFinished.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Broadcasting\Channel;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Broadcasting\PresenceChannel;
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class ApplicationDeploymentFinished
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function broadcastOn(): array
|
||||
{
|
||||
return [
|
||||
new PrivateChannel('application-deployment-finished'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -14,8 +14,11 @@ class EventServiceProvider extends ServiceProvider
|
||||
* @var array<class-string, array<int, class-string>>
|
||||
*/
|
||||
protected $listen = [
|
||||
Registered::class => [
|
||||
SendEmailVerificationNotification::class,
|
||||
// Registered::class => [
|
||||
// SendEmailVerificationNotification::class,
|
||||
// ],
|
||||
ApplicationDeploymentFinished::class => [
|
||||
SendDeploymentNotification::class,
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
28
app/Providers/SendDeploymentNotification.php
Normal file
28
app/Providers/SendDeploymentNotification.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Providers\ApplicationDeploymentFinished;
|
||||
use Illuminate\Contracts\Events\ShouldHandleEventsAfterCommit;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
|
||||
class SendDeploymentNotification implements ShouldQueue, ShouldHandleEventsAfterCommit
|
||||
{
|
||||
use InteractsWithQueue;
|
||||
/**
|
||||
* Create the event listener.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the event.
|
||||
*/
|
||||
public function handle(ApplicationDeploymentFinished $event): void
|
||||
{
|
||||
ray('SendDeploymentNotification');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user