简体   繁体   English

Laravel 5.3 Slack集成

[英]Laravel 5.3 Slack integration

I need to get access to Slack's Event API from my Laravel 5.3 application. 我需要从Laravel 5.3应用程序访问Slack的Event API。 I have installed vluzrmos's package from GitHub , but I can't get it to work properly. 我已经从GitHub安装了vluzrmos的软件包 ,但是无法正常工作。 I ran through all the steps in the installation, but when I try to do SlackUser::lists() in my Controller I get an error like this: 我完成了安装过程中的所有步骤,但是当我尝试在Controller中执行SlackUser::lists() ,出现如下错误:

Non-static method Vluzrmos\\SlackApi\\Contracts\\SlackUser::lists() cannot be called statically, assuming $this from incompatible context. 假设$ this来自不兼容的上下文,则不能静态调用非静态方法Vluzrmos \\ SlackApi \\ Contracts \\ SlackUser :: lists()。

Could you help? 你能帮忙吗? Thanks 谢谢

Assuming you have configured the providers & aliases correctly (in config/app.php ), you need to add: 假设您已正确配置了providersaliases (在config/app.php ),则需要添加:

use SlackUser;

to the top of your class, and then call: 到班级顶部,然后调用:

SlackUser::lists();

Please post your usage of SlackUser::lists(); 请发布您对SlackUser::lists(); if this doesn't solve your issue. 如果这不能解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM