mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-21 23:20:24 +00:00
update
This commit is contained in:
parent
aff951e9d6
commit
1441eaa6e4
4 changed files with 70 additions and 4 deletions
36
web/app/Events/DomainIsChanged.php
Normal file
36
web/app/Events/DomainIsChanged.php
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Events;
|
||||||
|
|
||||||
|
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 DomainIsChanged
|
||||||
|
{
|
||||||
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new event instance.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the channels the event should broadcast on.
|
||||||
|
*
|
||||||
|
* @return array<int, \Illuminate\Broadcasting\Channel>
|
||||||
|
*/
|
||||||
|
public function broadcastOn(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
new PrivateChannel('channel-name'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace app\Http\Controllers\Api;
|
namespace app\Http\Controllers\Api;
|
||||||
|
|
||||||
|
use App\Events\DomainIsChanged;
|
||||||
use App\Http\Controllers\ApiController;
|
use App\Http\Controllers\ApiController;
|
||||||
use App\Jobs\ApacheBuild;
|
use App\Jobs\ApacheBuild;
|
||||||
use App\Models\Domain;
|
use App\Models\Domain;
|
||||||
|
@ -111,6 +112,8 @@ class DomainsController extends ApiController
|
||||||
|
|
||||||
ApacheBuild::dispatchSync();
|
ApacheBuild::dispatchSync();
|
||||||
|
|
||||||
|
event(new DomainIsChanged($findDomain));
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'status' => 'ok',
|
'status' => 'ok',
|
||||||
'message' => 'Domain updated',
|
'message' => 'Domain updated',
|
||||||
|
|
26
web/app/Listeners/DomainIsChangedListener.php
Normal file
26
web/app/Listeners/DomainIsChangedListener.php
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Listeners;
|
||||||
|
|
||||||
|
use App\Events\DomainIsChanged;
|
||||||
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
|
|
||||||
|
class DomainIsChangedListener
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create the event listener.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle the event.
|
||||||
|
*/
|
||||||
|
public function handle(DomainIsChanged $event): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,12 +2,14 @@
|
||||||
|
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
|
use App\Events\DomainIsChanged;
|
||||||
use App\Events\ModelDomainCreated;
|
use App\Events\ModelDomainCreated;
|
||||||
use App\Events\ModelDomainDeleting;
|
use App\Events\ModelDomainDeleting;
|
||||||
use App\Events\ModelHostingSubscriptionCreated;
|
use App\Events\ModelHostingSubscriptionCreated;
|
||||||
use app\Events\ModelHostingSubscriptionCreating;
|
use app\Events\ModelHostingSubscriptionCreating;
|
||||||
use App\Events\ModelHostingSubscriptionDeleting;
|
use App\Events\ModelHostingSubscriptionDeleting;
|
||||||
use App\Events\ModelPhyreServerCreated;
|
use App\Events\ModelPhyreServerCreated;
|
||||||
|
use App\Listeners\DomainIsChangedListener;
|
||||||
use App\Listeners\ModelDomainCreatedListener;
|
use App\Listeners\ModelDomainCreatedListener;
|
||||||
use App\Listeners\ModelDomainDeletingListener;
|
use App\Listeners\ModelDomainDeletingListener;
|
||||||
use App\Listeners\ModelHostingSubscriptionCreatingListener;
|
use App\Listeners\ModelHostingSubscriptionCreatingListener;
|
||||||
|
@ -30,13 +32,12 @@ class EventServiceProvider extends ServiceProvider
|
||||||
Registered::class => [
|
Registered::class => [
|
||||||
SendEmailVerificationNotification::class,
|
SendEmailVerificationNotification::class,
|
||||||
],
|
],
|
||||||
ModelDomainDeleting::class => [
|
|
||||||
ModelDomainDeletingListener::class,
|
|
||||||
],
|
|
||||||
ModelPhyreServerCreated::class => [
|
ModelPhyreServerCreated::class => [
|
||||||
ModelPhyreServerCreatedListener::class,
|
ModelPhyreServerCreatedListener::class,
|
||||||
],
|
],
|
||||||
|
DomainIsChanged::class => [
|
||||||
|
DomainIsChangedListener::class,
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue