1. Go to this page and download the library: Download juliomotol/lapiv 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/ */
juliomotol / lapiv example snippets
namespace App\Http\Controllers\Api\Foo;
use App\Http\Controllers\Controller;
class FooV1Controller extends Controller
{
public function index()
{
return response()->json(['message' => 'This is Foo V1']);
}
}
namespace App\Http\Controllers\Api\Foo;
use JulioMotol\Lapiv\GatewayController;
class FooGatewayController extends GatewayController
{
protected array $apiControllers = [
FooV1Controller::class, // The first version of you API endpoint.
// Preceeding version implementations...
];
}