hkyss/evocms-extras
Extras for Evolution CMS (EVO CMS): a bundle of helper utilities and add-ons that extend the core with convenience functions, snippets, and integration tweaks. Install via Composer to add commonly needed features to your EVO projects without patching core files.
Start by locating the module’s install/status endpoints and any client code that currently reads errors.message. In v1.6.2, the response contract is now:
{"success": true, "data": ...}message sentence plus errors as an empty object ({}), not errors.messagedata, alongside the refusal messageThe first practical use case is the install flow: call the module’s install endpoint, branch on the envelope, show message on refusal, and render data as install diagnostics when the install fails.
Minimal integration checklist:
errors.message to read top-level message.data.data, not from the error object.Treat the module as an API client boundary and centralize envelope handling in one service/class rather than scattering json() calls through controllers and Livewire components.
Typical success handling:
$response = Http::post($moduleUrl.'/install', $payload);
$body = $response->json();
if (($body['success'] ?? false) === true) {
return $body['data'];
}
Typical refusal handling:
$message = $body['message'] ?? 'The operation could not be completed.';
$errors = $body['errors'] ?? [];
For failed installs, keep the response data for diagnostics:
if (($body['success'] ?? false) !== true) {
return [
'message' => $body['message'] ?? 'Install failed.',
'details' => $body['data'] ?? null,
];
}
In a Blade/Livewire UI, show message as the primary sentence and put data behind a details/expandable panel. Composer output can be long, so escape it and render it in a <pre> block rather than injecting it as HTML.
For transitional deployments, use a small normalizer:
$message = $body['message']
?? data_get($body, 'errors.message');
This lets older and newer module responses coexist briefly, but remove the fallback once all environments run v1.6.2 or later.
Testing pattern:
$response->assertJson([
'success' => true,
]);
$response->assertJsonPath('data.installed', true);
$response->assertJsonPath('errors', []);
$response->assertJsonMissingPath('errors.message');
errors.message is no longer the error sentence. Use top-level message. Searching for errors.message is the fastest way to find affected clients.errors is now an empty object on refusal. Do not treat errors as the message container, and do not assume it contains field-level validation details.data. Dropping data on failure makes debugging installs much harder.{ success, data: { success, data } }.success/message rather than assuming 4xx/5xx for all failures.data rather than reconstructing details from Composer output yourself.How can I help you explore Laravel packages today?