Download the PHP package boneq/laravel-onenet without Composer

On this page you can find all versions of the php package boneq/laravel-onenet. 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-onenet

Laravel-onenet

注意:会使用到laravel中的CaChe缓存还判断重复数据,请尽量将缓存配置成nosql方式(redis等)

onenet for Laravel是用于OneNet平台数据接收的一个laravel库

交流QQ群:320523384

安装

  1. 安装包

使用前请先阅读OneNet开发文档

配置

  1. 手动注册 ServiceProvider(laravel5.5+ 版本不需要手动注册):

  2. 创建配置文件:

3.1 (可选3.2)请修改应用根目录下的 config/onenet.php 中对应的项;

3.2 (可选3.1)或者在.env文件中写入下面内容

  1. 添加外观到 config/app.php 中的 aliases 部分(laravel5.5+不用手动添加)

从接收平台数据

Laravel csrf问题

  1. 在 CSRF 中间件里排除api的路由
  2. 关掉 CSRF 中间件(不推荐)

下面以接收OneNet平台推送数据例子:

假如您的域名为 app.dev 那么请登录OneNet平台 “第三方开放平台” 修改 “URL(请填写服务器配置)” 为: http://app.dev/onenet

路由:

注意:一定是 Route::any, 因为OneNet平台认证的时候是 GET, 推送平台消息时是 POST

然后创建控制器 OneNetController

发送数据到平台

添加终端

返回数据

注释:添加成功返回true和设备id,失败反回false

编辑终端

返回数据

注释:编辑成功返回true,失败反回false

删除终端

返回数据

注释:删除成功返回true,失败反回false

向终端发送命令

返回数据

注释:发送成功返回true,和数据的cmd_uuid,失败返回false

升级规划

会逐步优化请求操作相关的方法

License

MIT


All versions of laravel-onenet with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
guzzlehttp/guzzle Version ^6.3
boneq/laravel-onenet Version 1.1.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 boneq/laravel-onenet contains the following files

Loading the files please wait ....