Streams API requests
- Navigate with your browser to /api/inspect.
- You will now see HTTP requests being made to your application in real time. You do not need to refresh the browser.
Okay, that was the elevator shpiel. Here is the walkthrough of what is happening:
Hvent90/ApiInspector/ApiInspectorServiceProvider::boot() intercepts the
$request object with
Hvent90/ApiInspector/ApiInspectorServiceProvider::onBefore($request) takes the
$request object and, after instantiating
Pusher, uses Pusher to feed the data directly to
- Add this package to your Laravel project by typing
composer require hvent90/api-inspectorin your command line.
'Hvent90\ApiInspector\ApiInspectorServiceProvider'to the Providers array in
- Publish the
configuration filefor easy modifications by typing
php artisan vendor:publishin your command line. What does this do?
- Enter in your Pusher access keys in
The URI endpoint of
api/inspect will now load a view that streams all API requests in real time without refreshing the browser. Enjoy!
You can configure the behavior of ApiInspector via
falseand will enable or disable ApiInspector
app_idtake your Pusher keys
uriwill determine what URI endpoint is associated with the route
prefixwill add a prefix to the route
subdomainwill add a subdomain to the route
middlewareadds middleware to the route
The array called
route-modifiers is directly injected in to a route group that governs the API Inspector's route. You can add custom key/value pairs to the route-modifiers array to suite your application's needs.
You can locate and customize the default views found in
Visit https://pusher.com for more information on the Pusher service. It is quick, easy, and awesome. My implementation of Pusher in this package can be understood through Jeffrey Wayes' (of Laracasts.com) great video tutorial great video tutorial