CRUD
After migrating to the database I can now build the CRUD on each of these automatically using backpack commands as shown below.
For each Model the command adds a route, nav-item into the sidebar, traits, request files for validation/rules and a crud controller.
The nav-item sidebar is purely html code from Bootstrap which is using line-icons.
The route links to the controller which extends CrudController and uses traits for the CRUD opertation. Each part of CRUD (Create, Read, Update & Delete) has its own traits setup within the controller.
The first screenshot is the CRUD traits and the routes. The second is the setup operation for the Create. All of the CRUD traits have a setup operation apart from Delete which just deletes the data. The Update is set as $this->setupCreateOperation();
which just uses the same operation as create. I tried a few different setup methods but this seems to work perfectly fine.
Rules
Currently the not null fields when are left null show the error below which is messy, to counter this I need to setup Validation Rules.
When I setup rules it checks these before submitting the data and if does not match the rule then it errors. Below I setup rules for the category and left the slug as blank as I did above which now shows this error instead.
This looks a lot better than the above database error just by adding a few rules.