Releases: woduda/civicrm-laravel
Releases · woduda/civicrm-laravel
v0.8.0
Changed
- Bumped
woduda/civicrm-phprequirement from^0.7to^1.0 - Replaced deprecated
ApiExceptionalias withApiErrorExceptionin all catch blocks and@throwsPHPDoc (SyncContactJob,CreateActivityJob,TestConnectionCommand) CiviCrmServiceProvidernow wiresExponentialBackoffretry and PSR-3 logging intoTransport::createDefault()whencivicrm.retry.enabledistrue; previously this was a TODO comment guarded against the missing class in^0.7ProcessOutboxCommand::isPermanentFailure()now imports and checksAuthenticationExceptiondirectly instead of via aclass_exists()forward-compat guard;AuthenticationExceptioncauses immediate permanent failure of an outbox entryTestTransportgainswillThrow(Throwable)to support testing transport-level exceptions in job/command tests
v0.7.0
Fixed
OptionValue.createnow passesvalue: name(defaulting to the option'snamewhen
not set explicitly), preventing CiviCRM from auto-assigning sequential integers (1, 2, 3…)
as stored values — which would force the:namesuffix on every APIv4 custom-field writeOptionValueDefaccepts an optionalvaluefield; it can be set explicitly in both the
optionGroups.valuesandoptionValuesYAML sections
v0.6.2
Fixed
OptionValue.createnow passesvalue: name(defaulting to the option'snamewhen
not set explicitly), preventing CiviCRM from auto-assigning sequential integers (1, 2, 3…)
as stored values — which would force the:namesuffix on every APIv4 custom-field writeOptionValueDefaccepts an optionalvaluefield; it can be set explicitly in both the
optionGroups.valuesandoptionValuesYAML sections
v0.6.1
Fixed
optionGroupsYAML format now requires atitlefield and uses avalueskey for the option value list (groupName → {title, values?}) — CiviCRM'sOptionGroup.createAPI requirestitle; passing onlynamecaused a server-side validation errorSchemaAppliernow passestitletoOptionGroup.createSchemaDefinitionparser throwsValidationExceptionwith a clear message whentitleis absent from anoptionGroupsentry
Full changelog: https://github.com/woduda/civicrm-laravel/blob/main/CHANGELOG.md
v0.6.0
Added
OptionGroupDefDTO — declares a CiviCRM option group together with the values it should contain; parsed from theoptionGroupsmapping section in YAMLoptionGroupssection inSchemaDefinitionandSchemaApplier— nested dict syntax (groupName → list<{name, label?}>); the option group itself is created viaOptionGroup.createif it does not exist, then each value is ensured via the existingOptionValueget-or-create path; dry-run and idempotency are fully supportedresources/schema/example.yamlupdated with anoptionGroupsexample
Fixed
optionGroupssection in YAML was silently ignored bySchemaDefinition::fromArray()
v0.5.0
See CHANGELOG.md for details.
v0.4.0
Added
ContactTypeDefDTO — declares a CiviCRM contact sub-type with requirednameandparentName(base type:Individual,Organization, orHousehold) and optionallabel.contactTypes[]schema section —SchemaDefinitionandSchemaAppliernow support idempotent get-or-create ofContactTypeentities viacivicrm:apply-schema.ContactInput::$contactSubType— optional field passed ascontact_sub_typeintoCiviValues(); supported byfromArray()/toArray()round-trip andSyncContactJob.
v0.3.0
What's new
civicrm:apply-schema {file?} {--dry-run}— declarative YAML schema applier; idempotent get-or-create for custom groups/fields, tags, activity types, relationship types, and groups; dry-run mode shows what would be created without writing anythingSchemaDefinitionDTO with sub-DTOs (CustomGroupDef,CustomFieldDef,RelationshipTypeDef,OptionValueDef) — validates the YAML shape and throwsValidationExceptionwith human-readable context on bad inputSchemaApplierservice +SchemaApplyReport— separates created / existing / wouldCreate entries;toTable()ready for Artisan's table helperresources/schema/example.yaml— annotated reference schema (Volunteer Data group, relationship types, tags, activity type, group)civicrm.schema_pathconfig key (CIVICRM_SCHEMA_PATHenv) — default file path when the{file}argument is omitted
See CHANGELOG.md for full details.
v0.2.0 — Transactional Outbox
What's new
Transactional Outbox
Write CiviCRM side-effects into the same DB transaction as your domain model — no distributed transaction required.
Usage:
use CiviCrm\Laravel\Outbox\OutboxRepository;
use Illuminate\Support\Facades\DB;
DB::transaction(function () use ($outbox, $contactInput): void {
$domain->save();
$outbox->pushSyncContact($contactInput);
});Add to your scheduler:
$schedule->command('civicrm:outbox:work')->everyMinute();Publish the migration:
php artisan vendor:publish --tag=civicrm-laravel-migrations
php artisan migrateEnable in config/civicrm.php or .env:
CIVICRM_OUTBOX=trueAdded
OutboxEntryEloquent model (status,attempts,dedupe_key,available_at,last_errorcolumns)OutboxRepository—push()/pushSyncContact()/pushCreateActivity()/reserveBatch()/markDone()/markFailed()civicrm:outbox:workartisan command — synchronous drain with--limitand--max-attempts; exponential backoff capped at 3600 s;ValidationExceptioncauses immediate permanent failurecreate_civicrm_outbox_tablemigration stub (publishable)ContactInput::toArray()for lossless round-trip serialisation
See CHANGELOG.md for details.
v0.1.0
What's included
First release. Delivers the foundational service layer for the civicrm-laravel adapter:
config/civicrm.php— publishable config (tagcivicrm-config) with keys for connection, retry, queue, webhook, and outbox settings- Service provider — binds
Woduda\CiviCRM\ConfigandCiviCrmClientas singletons; auto-wires a pre-boundPsr\Http\Client\ClientInterfacefrom the host app or tests CiviCrmfacade — IDE-friendly@methodtags for all entity accessors (contacts,activities,contributions, etc.) andraw()civicrm:test-connection— artisan command that pings CiviCRM with a cheapContact.getrequest and prints the latency; exits non-zero on HTTP or transport errorsConfigurationException— package-local exception (implementsCivicrmException) thrown whenCIVICRM_BASE_URLorCIVICRM_API_TOKENare missing
Requires woduda/civicrm-php ^0.7, PHP ≥ 8.3, Laravel 11 / 12 / 13.