1. Go to this page and download the library: Download nf/restapi library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use NF\Facades\App;
use NightFury\RestApi\Routing\Router;
$api = App::make(Router::class);
$api->version('v1', function ($api) {
$api->get('test', 'App\Http\Controllers\TestController@test');
$api->get('test/{id}', 'App\Http\Controllers\TestController@show');
// ... more route goes here
});
return $api;
php command restapi:publish
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.