PHP code example of canedoc / json-query-builder

1. Go to this page and download the library: Download canedoc/json-query-builder 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/ */

    

canedoc / json-query-builder example snippets


\DB::table('table')->addSelect('column->path->to->element', 'as_name');

ModelName::addSelect('column->path->to->element', 'as_name');

\DB::table('table')->whereJsonValue('column->path->to->element', '=', 22);

ModelName::whereJsonValue('column->path->to->element', '>', 22);

\DB::table('table')->whereJsonIsValid('column');

ModelName::whereJsonIsInvalid('column');