Protect recordings per user, seed a demo login on container start, and bind-mount the app with Vite HMR for local Compose development.
13 lines
316 B
PHP
13 lines
316 B
PHP
<?php
|
|
|
|
use App\Models\Recording;
|
|
use App\Models\User;
|
|
use Illuminate\Support\Facades\Broadcast;
|
|
|
|
Broadcast::channel('recording.{recordingId}', function (User $user, int $recordingId): bool {
|
|
return Recording::query()
|
|
->whereKey($recordingId)
|
|
->where('user_id', $user->id)
|
|
->exists();
|
|
});
|