Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

wip

Andras Bacsaid59ec2548a9b
diff --git a/app/Events/TestEvent.php b/app/Events/TestEvent.php
index 0b94c3f289..2a4c138f67 100644
--- a/app/Events/TestEvent.php
+++ b/app/Events/TestEvent.php
@@ -13,14 +13,16 @@ use Illuminate\Queue\SerializesModels;
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}"),
];
}
}
diff --git a/app/Http/Livewire/Dashboard.php b/app/Http/Livewire/Dashboard.php
index 3eb9ccccc5..5056c989ec 100644
--- a/app/Http/Livewire/Dashboard.php
+++ b/app/Http/Livewire/Dashboard.php
@@ -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();
diff --git a/routes/web.php b/routes/web.php
index e44e9964c2..422fd5f0d0 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -38,12 +38,12 @@ use Illuminate\Support\Str;
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) {