Add Container field
This commit is contained in:
21
routes/broadcasting.php
Normal file
21
routes/broadcasting.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Broadcast::routes(['middleware' => ['web']]);
|
||||
|
||||
// Force admin guard authentication
|
||||
Route::post('/broadcasting/auth', function () {
|
||||
|
||||
if (auth('admin')->check()) {
|
||||
return Broadcast::auth(request());
|
||||
}
|
||||
|
||||
// Fallback check for normal users
|
||||
if (auth('web')->check()) {
|
||||
return Broadcast::auth(request());
|
||||
}
|
||||
|
||||
return response()->json(['message' => 'Unauthenticated'], 403);
|
||||
|
||||
})->middleware(['web']);
|
||||
Reference in New Issue
Block a user