Получение события на толкателе, но значение данных равно нулюJquery

Программирование на jquery
Ответить
Anonymous
 Получение события на толкателе, но значение данных равно нулю

Сообщение Anonymous »


I have a problem Pusher (i am receiving the broadcasted event, but the value of data is null after I have passed it correctly).

I'm using Pusher to dispatch events to my application. I send the event from the app to the pusher (along with my data). I'm sending a text message, just a simple string. On the Pusher debug console, I am receiving the event, but the value of my data is null. I have followed many videos on how to configure my laravel environment, but still, the value of my data is null.

I am a beginner in Pusher and Laravel. I am trying to develop an app of real-time chatting using Laravel Pusher and jQuery. I have watched a lot of video tutorials on it and do a lot of search on it, but still, I can not find a solution to my problem.

Route::post('/sender', function () { $text = User::find(1); return event(new FormSubmitted($text)); }); Event class

class FormSubmitted implements ShouldBroadcast { use Dispatchable, InteractsWithSockets, SerializesModels; public $text; public function __construct($text) { $this->$text = $text; } public function broadcastOn() { return new Channel('my-channel'); } public function broadcastAs() { return 'form-submitted'; } }
Изображение



Источник: https://stackoverflow.com/questions/578 ... ta-is-null
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Jquery»