PHP code example of claver / smart-query

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

    

claver / smart-query example snippets


'providers' => [    
	...,    
	\Claver\SmartQuery\SmartQueryServiceProvider::class,    
	...
]

use Claver\SmartQuery\HasSmartQuery;

class User extends Model{    
	use HasSmartQuery;
}

class UserController extends Controller{    
	public function index(Request $request){        
		$users = (new User())->resolve();        
		return response()->json($users);  
	}
}
bash
php artisan vendor:publish --provider="Spatie\\QueryBuilder\\QueryBuilderServicProvider" --tag="config"