wip: broadcast
This commit is contained in:
@@ -11,6 +11,13 @@
|
||||
|
|
||||
*/
|
||||
|
||||
// Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
|
||||
// return (int) $user->id === (int) $id;
|
||||
// });
|
||||
use App\Models\Application;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
|
||||
Broadcast::channel('custom.{teamId}', function (User $user, int $teamId) {
|
||||
if ($user->teams->pluck('id')->contains($teamId)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Events\ApplicationDeploymentFinished;
|
||||
use App\Http\Controllers\ApplicationController;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\DatabaseController;
|
||||
@@ -39,6 +40,11 @@ use Laravel\Fortify\Contracts\FailedPasswordResetLinkRequestResponse;
|
||||
use Laravel\Fortify\Contracts\SuccessfulPasswordResetLinkRequestResponse;
|
||||
use Laravel\Fortify\Fortify;
|
||||
|
||||
Route::get('/fire', function () {
|
||||
ApplicationDeploymentFinished::dispatch('kk0gg0s', 'stopped');
|
||||
|
||||
return 'Event has been sent!';
|
||||
});
|
||||
if (isDev()) {
|
||||
Route::get('/dev/compose', Compose::class)->name('dev.compose');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user