Download the PHP package dscmall/laravel-json-rpc without Composer
On this page you can find all versions of the php package dscmall/laravel-json-rpc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-json-rpc
JSON-RPC 2.0
JSON-RPC 2.0 is a remote procedure call protocol encoded in JSON. It is a very simple protocol, defining only a few data types and commands. JSON-RPC allows for notifications (data sent to the server that does not require a response) and for multiple calls to be sent to the server which may be answered out of order.
Install
Require this package with composer using the following command:
Installed
composer
is required (how to install composer).You need to fix the major version of package.
Usage example
Create routes
Register actions for your methods in ./routes/web.php
using the facade RpcRouter
:
This package already contains a simple controller implementation, which you can expand it or take it only as an example.
Add new route for RpcController
:
Don't forget about to load RPC routes if you want to specify routes not in the file
./routes/web.php
Create RPC controller
Create a new controller containing procedures to be called by JSON
request:
Send RPC-request
Events
When the Kernel@handle
method is called, some events are fired:
Event class | Description |
---|---|
ErroredRequestDetectedEvent |
Detected not valid request from stack |
RequestHandledEvent |
Means the remote method was successfully called |
RequestHandledExceptionEvent |
An exception was thrown while executing the request |
If necessary, you can create a Listener on this event and display received messages for debug.
The EventServiceProvider
included with your Laravel application provides a convenient place to register all of your application's event listeners.
data.
ChangeLog
Changes log can be found here.
Support
If you will find any package errors, please, make an issue in current repository.
License
This is open-sourced software licensed under the MIT License.
All versions of laravel-json-rpc with dependencies
illuminate/contracts Version ~6.0 || ~7.0 || ~8.0
illuminate/support Version ~6.0 || ~7.0 || ~8.0
illuminate/http Version ~6.0 || ~7.0 || ~8.0
illuminate/routing Version ~6.0 || ~7.0 || ~8.0
tarampampam/wrappers-php Version ^1.4 || ~2.0