我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Laravel事件:火灾有效载荷格式错误

I am currently using Laravel 4.2.

When I fire an Event sending the payload as array, listener retrieves the payload with it only being the first item in the associative array.

Firing the event:

$data = array('user' => $user, 'password_clear'  => $pass);
Event::fire('user.created', $data);

Listening like this:

Event::listen('user.created', function($data) {
    dd($data);
}

Dumps the following:

object(User)#809 (20) {
    ...
}

While I would have expected an array. Am I missing something?

Thanks, Federico

近期文章

  • PHP / Laravel - 目录权限的单元测试
  • 如何使用PHP Simple HTML dom获取此文本?
  • 表单验证消息与Laravel 5中的语言
  • 如何在php中对数据库表进行分页
  • Laravel 5.1 Ajax调用'Like'系统没有发生
  • 在bootstrap模式上提交信用卡表单
  • .htaccess密码保护拒绝请求uri
  • 名称空间的问题和在PHP中调用未定义的函数
  • 使用push-to-deploy初始化yii2框架的正确方法是什么?
  • Android图像GridView + MySql
  • wordpress插件 - 网站数据库
  • 从包含文件调用时,PHP preg_replace不替换
  • 我想从customer表中获取firstname
  • 无法在for循环中添加链接
  • PHP邮件批量邮件一个接一个
  • “请求 - > getBody”如何在苗条中运作
  • 如何在模板处理器的phpword中添加图片?
  • 将php值转换为javascript
  • PHP Soap故障“无法连接到主机”
  • 传入一个时间串mybatis怎样查询当月的数据?xml里怎样写?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华