Installation - ml-archive/nodes-php-api GitHub Wiki

To install this package you will need:

  • Laravel 5.1+
  • PHP 5.5.9+

You must then modify your composer.json file and run composer update to include the latest version of the package in your project.

"require": {
    "nodes/api": "^1.0"
}

Or you can run the composer require command from your terminal.

composer require nodes/api:^1.0

Once the package is installed the next step is dependant on which framework you're using.

Laravel

Open config/app.php and register the required service provider above your application providers.

'providers' => [
    Nodes\Api\ServiceProvider::class
]

If you'd like to make configuration changes in the configuration file you can pubish it with the following Aritsan command:

php artisan vendor:publish --provider="Nodes\Api\ServiceProvider"

Facades

There are two facades shipped with the package. You can add either of them should you wish.

Nodes\Api\Support\Facades\Api

This is a facade for the dispatcher, however, it also provides helper methods for other methods throughout the package.

DNodes\Api\Support\Facades\Route

This is a facade for the API router and can be used to fetch the current route, request, check the current route name, etc.

Configuration →