laravel-sluggable 0.2.0

Easy creation of slugs for your Laravel Rust models: a port of cviebrock/eloquent-sluggable.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! The package's error.

/// `SlugService::create_slug` was given an attribute that isn't one of the model's slugs, and no
/// settings: PHP's `InvalidArgumentException`.
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
#[error(
    "Argument 2 passed to SlugService::createSlug ['{attribute}'] is not a valid slug attribute for model {model}."
)]
pub struct InvalidSlugAttribute {
    /// The attribute that was given.
    pub attribute: String,
    /// The model's name.
    pub model: &'static str,
}