Skip to main content

laravel_model_states/
lib.rs

1//! State machines for your Laravel Rust models: a port of
2//! [spatie/laravel-model-states](https://github.com/spatie/laravel-model-states).
3//!
4//! A state field is a `laravel::Enum` that implements [`State`]; its [`StateConfig`] sets the
5//! default state and the allowed transitions, and [`HasStates`] transitions a model's state
6//! column. See the [README](https://github.com/rivervo/laravel-model-states) for the guide.
7
8mod error;
9mod has_states;
10mod state;
11mod transition;
12
13pub use crate::error::{
14    CouldNotPerformTransition, InvalidConfig, TransitionNotAllowed, TransitionNotFound, UnknownState,
15};
16pub use crate::has_states::{HasStates, StateChanged, StateScopes, set_default_state, where_not_state, where_state};
17pub use crate::state::{IntoStates, State, StateConfig};
18pub use crate::transition::{DefaultTransition, Transition, save_state};