Skip to content

Mixins Overview

Bavard uses Dart mixins to provide optional functionality to your models. This allows you to compose your models with exactly the features they need, keeping them lightweight.

Available Mixins

MixinDescription
HasTimestampsAutomatically manages created_at and updated_at.
HasSoftDeletesEnables "trash" functionality instead of permanent deletion.
HasUuidsUses UUID v4 for the primary key instead of auto-incrementing integers.
HasGlobalScopesApplies default query constraints (e.g., multi-tenancy).
HasGuardsAttributesProvides mass-assignment protection (included by default in Model).
HasEventsProvides lifecycle hooks (included by default in Model).

Released under the MIT License. Crafted with ❤️ for the Dart ecosystem.