Tag: laravel 5.2

使用Redis和Socket.io在Laravel 5.2中进行事件广播

我把Laravel 5.1更新到5.2,这个事件不再播放。 我正在使用Laravel家园,使用php 7和hhvm,Node 5.3.0,Redis 3.0.6。 Redis工作正常。 (我试过Redis ::发布)。 我解雇了这个事件,但是我没有收到任何消息。 事件类 namespace App\Events; use App\Events\Event; use Illuminate\Queue\SerializesModels; use Illuminate\Contracts\Broadcasting\ShouldBroadcast; class UserSignedUp extends Event implements ShouldBroadcast { use SerializesModels; public $username; /** * Create a new event instance. * * @return void */ public function __construct($username) {print_r($username); $this->username = $username; } /** * Get the channels […]

抓取Api:无法从本地主机获取数据

我一直在尝试使用nativescript创build一个android应用程序。我使用获取模块从我的服务器获取响应。当我试图从httpbin.org/get获取响应时,它是可以的。但是当我试图获得响应从我的本地服务器,我得到networking请求失败。 错误。 发送到httpbin.org/get- return fetchModule.fetch("https://httpbin.org/get").then(response => { return response.text(); }).then(function (r) { console.log(r); }, function (e) { console.log(e); }); 发送到本地主机:8000 / api- return fetchModule.fetch("http://localhost:8000/api").then(response => { return response.text(); }).then(function (r) { console.log(r); }, function (e) { console.log(e); }); 当我尝试通过请求模块得到localhost:8000 / api中纯node.js的响应时,它运行良好。但是现在,我不知道如何使用fetch模块来解决nativescript中的这个问题。