Category Management

The Admin or Creator user has access to a categories management table page.


The theme has some default categories but an Admin or Creator user can manage these categories. The categories management can be accessed by clicking Category Management from the Laravel Examples section of the sidebar or adding /laravel-category-management in the url. The user is able to add, edit and delete categories. For adding a new category you can press the + New Category button or add in the url /laravel-new-category. If you would like to edit or delete a category you can click on the Action column. It is also possible to sort the fields or to search in the fields.

On the page for adding a new category you will find a form which allows you to fill the name and the description of the new category.

The `App\Http\Livewire\LaravelExample\NewRCategory` takes care of data validation when changing a category and updating it:

              
                public function rules() {
                    return [
                        'category.name' => ['required', Rule::unique('categories', 'name')->ignore($this->category)],
                        'category.description' => ''
                    ];
                }

                public function editRole() {
                    $this->validate();
                    $this->category->update();
                    $this->showSuccesNotification = true;
                }