onenet / laravel
This package can be used to connect to onenet
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/onenet/laravel
Requires
- php: >=8.0
- guzzlehttp/guzzle: 7.4.x
README
Note: The Cache in laravel will be used to determine duplicate data. Please try to configue the cache as nosql (redis,etc.)
Onenet for laravel is a laravel library for OneNet platform data reception
install
- Insatll the package
Please read the OneNet development documentation before use
composer require "hazmaaslam-cs/laravel-onenet-sdk:1.1.0"\
configure
- manually register 'ServiceProvider'
Onenet\Laravel\OneNetServiceProvider::class,
- Create a configuratioin file:
php artisan vendor:publish --provider="Onenet\Laravel\OneNetServiceProvider"
- (optional) Edit config/onenet.php file or write the following in the .env file
OnetNet_Token=Token OnetNet_EncodingAESKey=Message encryption and decryption key OneNet_APIKey=Key in device operation 4. Add the appearance to the 'alaises' in 'confit/app.php' (laravel 5.5+ doesn't need to be added manually) ```php 'OneNet'=>Onenet\Laravel\Facades\OneNet::class,
Receive platform data from
Lraravel csrf issues
- Exclude api routing in CSRF middleware 2 .Turn off CSRF middleware (not recommended)
The following is an example of receiving push data from the OneNet platform:
If your domain name app.devis , please log in to the "Third Party Open Platform" of the OneNet platform and modify the "URL (please fill in the server configuration)" as: http://app.dev/onenet.
routing:
Route::any('\onenet','OneNetController@onenet'); > Note: It must be Route::any, because when the OneNet platform is certified, it is when the GETplatform message is pushed.POST