rinvex / laravel-categories

Rinvex Categorizable is a polymorphic Laravel package, for category management. You can categorize any eloquent model with ease, and utilize the power of Nested Sets, and the awesomeness of Sluggable, and Translatable models out of the box.
MIT License
454 stars 67 forks source link

Error on using normal create method with no slug #3

Closed NassarX closed 6 years ago

NassarX commented 7 years ago

Hi @Omranic

Trying to create new category using normal eloquent Category::create method every time it redirect back to create page and no categories created .

The problem was that I don't send slug attribute with other category data and found that you made it as a required $this->setRules([ 'slug' => 'required|alpha_dash|unique:'.config('rinvex.categorizable.tables.categories').',slug', ]);

So wonder why required although make use of spatie/laravel-sluggable to handle create slug from category name.

Omranic commented 7 years ago

It should be auto created if not supplied, let me check this & get back to you 👍

pilishen commented 7 years ago

got the same problem

Yario commented 6 years ago

Is there way to disable translation totally? It's unnecessary for my purpose and just make a mess

Omranic commented 6 years ago

@NassarX The slug issue should be fixed in latest releases of this package. Please feel free to reopen this issue or a new one if you need further assistance 🙂

@Yario You can ignore translations and use the package like normal, translations are handled gracefully, automagically behind scenes. And if you still need to remove it totally, then you can override the model & modify the migrations, or even fork the whole package if required 🙌