# Milbel CMS

## Conventions

### Post Types

-   Post types must be created as new modules
-   Post types must be named in the singular, following PascalCase naming convention. The first letter of each word must be capitalized
-   If a post type has additional fields beyond those standard to posts, these fields must be included in the Fillable array in the model
-   Additional inputs on the create/edit screen must be added in a partial under the module views following the structure /admin/partials/form.blade.php
-   Each post type model must include a function called rules, which will return an array of validation rules specific to that post type. If there are no specific validation rules, this function should return an empty array.

### Components

-   Components must be added as new modules
-   Components must be named in the singlular, following PascalCase naming convention. The first word of the component name must be a capitalized 'Component'
-   Each component needs a view titled editor.blade.php which will contain the form elements for managing the component content in the post editor.

## Changes Needed

### General

-   Refine naming conventions to make code more readable/logical

### Templates

-   Need to add options for background images (position, size, repeat etc.)
-   Refactor nestable++, seperate out functionality, and share between modules rather than having individual versions for template and menu managements

### Posts

-   Unique slug field
-   Meta inputs
-   Meta table to allow for key value pair meta fields to be easily added

### Categorization

-   Add post category superclass, and develop structure for extending categories for post types

### Components

-   Better define required fields in components

### Sidebar

-   Dynamically Load content/editors
-   Dynamically include in page based on existence of content

### Revision Table

-   Add table to track post revisions, storing a post id and a json array of all values stored against the post and related modules
