rinvex / laravel-attributes

⚠️ [ABANDONED] Rinvex Attributable is a robust, intelligent, and integrated Entity-Attribute-Value model (EAV) implementation for Laravel Eloquent, with powerful underlying for managing entity attributes implicitly as relations with ease. It utilizes the power of Laravel Eloquent, with smooth and seamless integration.
MIT License
434 stars 104 forks source link

Slug should be snake_case even it's manually provided #51

Closed IsraelOrtuno closed 6 years ago

IsraelOrtuno commented 6 years ago

As of now, the slug is automatically generated in an _snakecase style only when it gets generated using the Sluggable package (no slug provided when creating the attribute).

When we create an attribute providing a slug, it won't get formatted as _snakecase.

Reproduce

app('rinvex.attributes.attribute')->create([
    'slug' => 'foo-bar',
    'type'     => 'integer',
    'name'     => 'Count',
    'entities' => ['App\User'],
])

This will produce a foo-bar slug rather than foo_bar.

Omranic commented 6 years ago

Good point, I’ll add slug mutator to always enforce underscores..