This is a stripped down version of laravel-lumen-crud-wizard-client
and can be used for calling laravel-crud-wizard-free
composer require macropay-solutions/laravel-crud-wizard-client-free
$crud = new \MacroPaySolutions\LaravelCrudWizardClient\RequestBuilder(\env('API_BEARER'), \env('APP_URL'));
try {
$result = $crud->list('clients', $crud->getBuilder()->sort('country', 'asc')
->sort('zip')->equals('name', 'alt')->withRelation('relation')
->withRelations(['rel1', 'rel2'])
->addCountRelations(['relation1'])->addExistRelation('relation2');
$result = $crud->get('clients', '73', ['rel1', 'rel2']);
$result = $crud->delete('clients', '73');
$result = $crud->create('clients', [
'active' => '1',
'name' => 'abc',
// ...
]);
$result = $crud->update('clients', '73', [
'active' => '1',
'name' => 'abc',
// ...
]);
} catch (\Exception $e) {
$decodedErrorMessage = \json_decode($e->getMessage());
echo $decodedErrorMessage->message;
}
$decodedResult = \json_decode($result);
Discover more methods available by installing it.