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
| Mixin | Description |
|---|---|
| HasTimestamps | Automatically manages created_at and updated_at. |
| HasSoftDeletes | Enables "trash" functionality instead of permanent deletion. |
| HasUuids | Uses UUID v4 for the primary key instead of auto-incrementing integers. |
| HasGlobalScopes | Applies default query constraints (e.g., multi-tenancy). |
HasGuardsAttributes | Provides mass-assignment protection (included by default in Model). |
HasEvents | Provides lifecycle hooks (included by default in Model). |