I’m trying to authorize a private channel. I’m using Vue.js as SPA, Laravel Sanctum for auth, and Laravel for api. As the Laravel’s documentation, I wrote my channel callbacks on "channels.php" under "routes" folder. But it wasn’t working. It was saying 403 when I tried to authenticate the channel. Then I moved my channel callbacks ..

I am getting 405 (Method not allowed) status for laravel private channel from reactJS. This is working for userId=1 but returning 405 for all other users. Here is the code for Laravel class BroadcastServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() { Broadcast::routes([ "middleware" => ..

I am getting 401 (Unauthorized) status for laravel private channel from reactJS. This is working for userId=1 but returning 401 for all other users. Here is the code for Laravel class BroadcastServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() { Broadcast::routes([ "middleware" => [‘api’, ‘jwt.auth’], ..

I’ve been struggling for a while now and can’t find a way to make this work. My project is on Laravel 8 I’m using Redis and laravel-echo-server (since it doesn’t seem maintained I also tried with a hand-made express/socket.io server) The problem : When I fire the event, it’s received by Redis and Laravel Echo ..

Good morning people, everything fine? I have an application in Laravel 8 that uses Livewire components to update screens without having to implement AJAX. I would like to know the easiest way to work with Broadcast (if it exists) using Livewire to update the screen of other users in real time when an action is ..

-Hey, I’m actually creating an online exam application I want to add a system that grants to teachers to see live what students are typing in a text area (or input) using broadcast or laravelecho. -So my Scenario is when a student is typing, the teacher can see what he is typing if he presses ..

event is: public $chat ; public function __construct($chat) { $this->chat =$chat; } public function broadcastOn() { // return new Channel(‘recieve-chat’); return new PrivateChannel(‘recieve-chat’ ); } routes/channels.php is: Broadcast::channel(‘recieve-chat’, function ($user ) { return true; // return$user->id === $reciever_id; }); in blade file: <script> window.addEventListener(‘DOMContentLoaded’ , function () { Echo.private(‘recieve-chat’) .listen(‘ChatBroad’, (e) => { .. Read more I’ve been stuck with Broadcasting on private channel in authentication part. What I have done is, I made custom authEndpoint in Echo server "authEndpoint": "/broadcastAuth", Controller: public function broadcastAuth(Request$request){ $channel =$this->normalizeChannelName($request->channel_name);$broadcaster = new CustomBroadcaster(); $channelAuth =$broadcaster->verifyUserCanAccessChannel($request,$channel); if($channelAuth){ return true; } return response()->json([ ‘message’ => ‘Not allowed’ ], 403); } I .. Read more I am having an issue with the auth:api guard working with broadcasting. I get the error Class AppHttpMiddlewareAuthenticate:api does not exist if I call php artisan route:list. BroadcastServiceProvider.php: <?php namespace AppProviders; use IlluminateSupportFacadesBroadcast; use IlluminateSupportServiceProvider; class BroadcastServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() { .. Read more If I set my channel like this, I get console error 403. note:: if ($user->statue) isn’t reg. Broadcast::channel(‘using’, function ($user) { if($user->status==’reg’){ return $user->id; } }); If I set my channel like this, everything is okay. Broadcast::channel(‘using’, function ($user) { if($user->status==’reg’){ return$user->id; }else{ return ‘invalid’; } }); But I need to set my chennel ..

I have a users table (default included by Laravel) for authenticated users. I also have a visitors table which is filled by a middleware. It creates a visitor when it first visits the site, that visitor gets a random token which is stored to a cookie. If the visitor visits the site again, it’s recognised ..

A user can create a game which returns a random game_id that is also stored in the db. Other users can then scan this game_id that is displayed in the form of a QR code. This is working fine. Now, I only want the users that are connected to the same game_id to be allowed ..

I have a problem when I want to run a event, constructor works but doesn’t work broadcast on method!!! this is my event: class ExampleEvent implements ShouldBroadcast { use Dispatchable, InteractsWithSockets, SerializesModels; public $data; /** * Create a new event instance. * * @return void */ public function __construct(array$data) { $this->data =$data; } ..