PHP code example of shirokovnv / laravel-query-api-backend

1. Go to this page and download the library: Download shirokovnv/laravel-query-api-backend 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/ */

    

shirokovnv / laravel-query-api-backend example snippets


php artisan vendor:publish --provider="Shirokovnv\LaravelQueryApiBackend\LaravelQueryApiBackendServiceProvider" --tag=config

$queryRunner = LaravelQueryApiBackend::makeQueryRunnerInstance($request, $options);
$queryResult = $queryRunner->run();
$queryRunner->saveLog();
      
return response()->json($queryResult);

    public static function shouldAuthorizeAbilities(): array;

    return ['create', 'update', 'view', 'viewAny'];

    public static function shouldValidateActions(): array;

    return ['create', 'fetch', 'update', 'delete'];
 bash
php artisan migrate