wip
This commit is contained in:
parent
e0cefc787a
commit
d59ec2548a
@ -13,14 +13,16 @@
|
||||
class TestEvent implements ShouldBroadcast
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
public $teamId;
|
||||
public function __construct()
|
||||
{
|
||||
$this->teamId = auth()->user()->currentTeam()->id;
|
||||
}
|
||||
|
||||
public function broadcastOn(): array
|
||||
{
|
||||
return [
|
||||
new Channel('public'),
|
||||
new PrivateChannel("custom.{$this->teamId}"),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -10,12 +10,17 @@ class Dashboard extends Component
|
||||
{
|
||||
public $projects = [];
|
||||
public $servers = [];
|
||||
protected $listeners = ['echo:public,TestEvent' => 'notifyNewOrder'];
|
||||
|
||||
public function notifyNewOrder()
|
||||
{
|
||||
$this->emit('success', 'New order received!');
|
||||
}
|
||||
// public function getListeners()
|
||||
// {
|
||||
// $teamId = auth()->user()->currentTeam()->id;
|
||||
// return [
|
||||
// "echo-private:custom.{$teamId},TestEvent" => 'notifyNewOrder',
|
||||
// ];
|
||||
// }
|
||||
// public function notifyNewOrder()
|
||||
// {
|
||||
// $this->emit('success', 'New order received!');
|
||||
// }
|
||||
public function mount()
|
||||
{
|
||||
$this->servers = Server::ownedByCurrentTeam()->get();
|
||||
|
@ -38,12 +38,12 @@
|
||||
use Laravel\Fortify\Contracts\FailedPasswordResetLinkRequestResponse;
|
||||
use Laravel\Fortify\Contracts\SuccessfulPasswordResetLinkRequestResponse;
|
||||
use Laravel\Fortify\Fortify;
|
||||
Route::get('/fire', function () {
|
||||
event(new \App\Events\TestEvent());
|
||||
return 'fired';
|
||||
});
|
||||
if (isDev()) {
|
||||
|
||||
if (isDev()) {
|
||||
Route::get('/fire', function () {
|
||||
event(new \App\Events\TestEvent());
|
||||
return 'fired';
|
||||
});
|
||||
Route::get('/dev/compose', Compose::class)->name('dev.compose');
|
||||
}
|
||||
Route::post('/forgot-password', function (Request $request) {
|
||||
|
Loading…
Reference in New Issue
Block a user