Download the PHP package violet250/laravel-wechat without Composer

On this page you can find all versions of the php package violet250/laravel-wechat. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-wechat

laravel-wechat

注意:此版本为 3.x 版本,不兼容 2.x 与 1.x,与 overtrue/wechat 3.x 同步

微信 SDK for Laravel 5 / Lumen, 基于 overtrue/wechat

本项目只适用于,只有一个固定的账号,如果是开发微信公众号管理系统就不要使用了,直接用 overtrue/wechat 更方便些。

交流QQ群:319502940

安装

  1. 安装包文件

配置

Laravel 应用

  1. 注册 ServiceProvider:

  2. 创建配置文件:

  3. 请修改应用根目录下的 config/wechat.php 中对应的项即可;

  4. (可选)添加外观到 config/app.php 中的 aliases 部分:

Lumen 应用

  1. bootstrap/app.php 中 82 行左右:

  2. ENV 中支持以下配置:

  3. 如果你习惯使用 config/wechat.php 来配置的话,请记得在 bootstrap/app.php 中19行以后添加:

使用

注意:

  1. Laravel 5 默认启用了 CSRF 中间件,因为微信的消息是 POST 过来,所以会触发 CSRF 检查导致无法正确响应消息,所以请去除默认的 CSRF 中间件,改成路由中间件。可以参考我的写法:overtrue gist:Kernel.php 5.1 里的 CSRF 已经带了可忽略部分url的功能,你可以参考:http://laravel.com/docs/master/routing#csrf-protection

下面以接收普通消息为例写一个例子:

假设您的域名为 overtrue.me 那么请登录微信公众平台 “开发者中心” 修改 “URL(服务器配置)” 为: http://overtrue.me/wechat

路由:

注意:一定是 Route::any, 因为微信服务端认证的时候是 GET, 接收用户消息时是 POST

然后创建控制器 WechatController

我们有以下方式获取 SDK 的服务实例

使用容器的自动注入
使用外观

config/app.phpalias 部分添加外观别名:

然后就可以在任何地方使用外观方式调用 SDK 对应的服务了:

更多 SDK 的具体使用请参考:https://easywechat.org

License

MIT


All versions of laravel-wechat with dependencies

PHP Build Version
Package Version
Requires overtrue/wechat Version ~3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package violet250/laravel-wechat contains the following files

Loading the files please wait ....