PHP code example of evgeny-l / rest-api-core

1. Go to this page and download the library: Download evgeny-l/rest-api-core 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/ */

    

evgeny-l / rest-api-core example snippets


EvgenyL\RestAPICore\RestAPICoreServiceProvider::class,
bash
php artisan vendor:publish --provider="EvgenyL\RestAPICore\RestAPICoreServiceProvider" --tag=config

use EvgenyL\RestAPICore\Http\Exceptions\APIJSONHandlerTrait;

...
    public function render($request, Exception $exception)
    {
        if ($request->expectsJson()) {
            return $this->handleJSONResponse($request, $exception);
        }
        return parent::render($request, $exception);
    }
    
...