caneara/axiom
Axiom is a Laravel package for adding finite state machines to Eloquent models. Define states, transitions, and guards in one place, then move records through workflows safely with expressive, testable code that keeps order, subscription, and approval status changes clean.
src/Rules, tests/Rules, and any published config/ file. The v3.2.1 addition is a new Vietnamese citizen rule, so start with that rule class and its tests to confirm expected input format.use Vendor\Package\Rules\VietnameseCitizenId;
public function rules(): array
{
return [
'citizen_id' => ['required', 'string', new VietnameseCitizenId()],
];
}
If the package registers string aliases, confirm the alias in the README before using 'vietnamese_citizen_id'; otherwise instantiate the rule object directly.
required, string, digits:12, and unique where appropriate.'citizen_id' => [
'required',
Rule::when($this->input('nationality') === 'VN', [new VietnameseCitizenId()]),
],
Rules class or custom request base class so the new rule is applied consistently across registration, profile update, and admin forms.messages() method rather than editing package files.Validator::make() with the same rule object so behavior matches HTTP validation.new VietnameseCitizenId().composer.json; validation-rule packages often support a range of Laravel releases but may not test every combination.Validator::make($data, $rules)->errors() in a tinker session or test rather than relying only on browser feedback.^3.2 if you want the Vietnamese rule available consistently across deployments.How can I help you explore Laravel packages today?