Skip to content

Commit

Permalink
Standardise events
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhamp committed Nov 19, 2024
1 parent fc070a2 commit 83edd85
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
25 changes: 25 additions & 0 deletions src/Events/MenuBar/MenuBarClicked.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Native\Laravel\Events\MenuBar;

use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class MenuBarClicked implements ShouldBroadcastNow
{
use Dispatchable, InteractsWithSockets, SerializesModels;

public function __construct(public array $combo, public array $bounds, public array $position)
{
}

public function broadcastOn()
{
return [
new Channel('nativephp'),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class MenuBarContextMenuOpened implements ShouldBroadcastNow
class MenuBarRightClicked implements ShouldBroadcastNow
{
use Dispatchable, InteractsWithSockets, SerializesModels;

public function __construct(public array $combo, public array $bounds)
{
}

public function broadcastOn()
{
return [
Expand Down
25 changes: 25 additions & 0 deletions src/Events/MenuBar/MenuBarRightClicked.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Native\Laravel\Events\MenuBar;

use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class MenuBarRightClicked implements ShouldBroadcastNow
{
use Dispatchable, InteractsWithSockets, SerializesModels;

public function __construct(public array $combo, public array $bounds)
{
}

public function broadcastOn()
{
return [
new Channel('nativephp'),
];
}
}

0 comments on commit 83edd85

Please sign in to comment.