*`heading`: The title that will appear for this page
*`model`: The model that will be accessed on this page
*`id`: Always set this to `$id`
*`item`: Always set this to `$item`
*`imgup`: Set this to `true` to enable image upload, otherwise set to `false`
*`help_text`: An optional value that will add a box containing help text above the form if set
*`columns`: An array containing a set of arrays where:
*`name` is the name of the column to be edited
*`type` is the type of column (details below)
*`label` is an optional value that overrides the visible column name
###### Editable Column Types
The following is a list of possible `types` in the `columns` array for Editable Items:
*`text`: Text input field for text data
*`mkd`: Markdown editor for text data containing markdown
*`date`: Date and time selection tool for date/time data
*`hidden`: Fields that will contain values to pass to the update function but won't appear on the page (this must be used for the sort column)
#### Edit Item Functionality
Editable models must have an entry in the switch statement of the `postEdit` function to make create and edit functionality work:
```php
switch ($request['model']) {
case 'shows':
$item = $id == 'new' ? new Shows : Shows::find($id);
break;
case 'news':
$item = $id == 'new' ? new News : News::find($id);
break;
default:
return 'model-access-fail';
}
```
#### Additional Requirement for Sortable Models
Sortable models must have an entry in the switch statement of the `postReorder` function to make sorting functionality work:
```php
switch ($request['model']) {
case 'news':
$items = new News();
break;
default:
return 'model-access-fail';
}
```
#### Additional Requirements for Image Upload
If the value of `imgup` has been set to `true`, ensure `public/uploads/model_name` exists (where `model_name` is the name of the given model) and contains a `.gitkeep` that exists in version control.
By default, uploaded images are saved in JPEG format with the value of the `id` column of the respective row as its name and `.jpg` as its file extension.
When a row is deleted, its respective image will be deleted as well if it exists.
Add an array to the menu array in `resources/views/dashboard/elements/menu.blade.php` where the visible title as the first item and the model name as the second: