Category : events

I’m using Laradock as a development environment and using the laravel-echo-server included in it. For public channels it works normally, however when I try to use private channels I get the following error on laravel-echo-server. laravel-echo-server_1 | [1:19:22 AM] – Sending auth request to: localhost/broadcasting/auth laravel-echo-server_1 | laravel-echo-server_1 | [1:19:22 AM] – Error authenticating IHZ3HwHH9iLqb2uKAAAW ..

Read more

Function name must be a string {"exception":"[object] (Error(code: 0): Function name must be a string at C:wamp64wwwLaravelprojectsEustardEustardNewEustard-customers-Laravel-API-vendorlaravelframeworksrcIlluminateEventsDispatcher.php:404) I get the above error for the below code. The Notifications table has status column which stores boolean value. i wanted to update the status column to true when the job is run successfully. Doing dd() in listener ..

Read more

The Notifications table has status column which stores boolean value. i wanted to update the status column to true when the job is run successfully. Doing dd() in listener shows output but the column is not updating in db. Can someone help on this?? Job class SendEmailJob implements ShouldQueue { public function handle() { Notification::send($this->user, ..

Read more

I deploy my Laravel project on multiple servers, and my balancer distributes visitors between them. I want to organize broadcast Events via Redis (queue) and listen to Events on all servers (servers have a common redis db). I have Event class: use IlluminateBroadcastingChannel; use IlluminateBroadcastingInteractsWithSockets; use IlluminateContractsBroadcastingShouldBroadcast; use IlluminateFoundationEventsDispatchable; use IlluminateQueueSerializesModels; class BaseRedisEvent implements ShouldBroadcast ..

Read more

I have created Laravel Event and Listener when a user’s profile is updated it’s gonna trigger and send the email. The boot method in User modal public static function boot() { parent::boot(); set_env_value_for_send_grid(); static::updated(function ($user) { if ($user->user_status == ‘Active’) { event(new UserStatusChangeEvent($user)); } }); } The UserStatusChangeEvent event class looks like this class UserStatusChangeEvent{ ..

Read more

I am new to Laravel, and have installed github.com/juliomotol/laravel-auth-timeout into my application. Everything works fine until I try to implement a listener class for the preinstalled event. I am trying to have the user redirected to the login page, with a informative banner showing they have been logged out due to inactivity, as soon as ..

Read more

The below controller function triggers both retrieved & created events of observer. I’m not getting why this happens. I want only the created event to trigger when the insertion given in the controller happens. Any helps to solve this is much appreciated. Controller public function insert(Request $request) { $validator = Validator::make( $request->all(), [ ‘orderId’ => ..

Read more

I have an problem. I created ResponseReceived listener to log some info, but I need understand where this event was dispatched. As I can see I don’t have context in event. It will be perfect to get access to parent Request or App intstance. Did somebody has similar problem and how to resolve this? I ..

Read more

I’m trying to trigger some action after create and update my model following Laravel docs regarding events and observers. So I have: AppObserversPedidoObserver.php: <?php namespace AppObservers; use AppPedido; use IlluminateSupportFacadesLog; class PedidoObserver { public $afterCommit = true; public function created(Pedido $pedido) { Log::info(‘A new order has been created and the properly method has been triggered’); ..

Read more

<select wire:change="selectOrder($event.target.value)"> @foreach($orders as $option) <option value="{{$option[‘id’]}}">{{$option[‘id’]}}</option> @endforeach </select> public function selectOrder($order) { $this->order = $order; $this->products = $this->order->products; } here is a live wire component that has a select input I need when changing the select the function selectOrder is executed with the selected value, i use $event magic action but i got the ..

Read more

when I trigger an event, the channel it’s being broadcasted on is getting this format of response: {"channel":"events","event":"AppEventsRealTimeMessage","data":"{"message":"a","channel":"events"}"} I can change the data part from broadcastWith and the previous output will look like this: {"channel":"events","event":"AppEventsRealTimeMessage","data":"{"a"}"} the code is: public function broadcastWith(){ return [$this->message]; } But I want the response to be like this: "a". Source: ..

Read more

I have an issue with Laravel Pusher events first of all when I fire the event from the pusher debug console it works fine But when I try to do it from my laravel controllers, it doesn’t. and here is my code my event class FileAdded implements ShouldBroadcast { use Dispatchable, InteractsWithSockets, SerializesModels; /** * ..

Read more

Did my research and found nothing about this topic. In the docs: https://mailchimp.com/developer/marketing/guides/track-outside-activity-events/#create-an-event Apparently said how to create an event with options, using the library that they said which in PHP is: composer require mailchimp/transactional I can ping, do all the simple requests without problem but some options for events are not even avaliable, for ..

Read more

I need to send the response from a channel to the sender socket when an event from backend is invoked. Right it successfully broadcasts to all other sockets but not the sender. How can I achieve this? socket.js ‘use strict’; var cors = require(‘cors’); var app = require(‘express’)(); app.use(cors({origin: ‘*’})); var server = require(‘http’).Server(app); var ..

Read more