diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index 792401e..1f81a0a 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -42,7 +42,7 @@ class DashboardController extends Controller { 'heading' => 'Contact Form Submissions', 'model' => 'contact', 'rows' => Contact::getContactSubmissions(), - 'cols' => Contact::$dashboard_columns + 'columns' => Contact::$dashboard_columns ]); } @@ -52,7 +52,7 @@ class DashboardController extends Controller { 'heading' => 'Subscriptions', 'model' => 'subscriptions', 'rows' => Subscriptions::getSubscriptions(), - 'cols' => Subscriptions::$dashboard_columns + 'columns' => Subscriptions::$dashboard_columns ]); } diff --git a/readme.md b/readme.md index 3274de0..1e6b492 100644 --- a/readme.md +++ b/readme.md @@ -40,7 +40,7 @@ First add a function to generate the page: 'heading' => 'Contact Form Submissions', 'model' => 'contact', 'rows' => Contact::getContactSubmissions(), - 'cols' => Contact::$dashboard_columns + 'columns' => Contact::$dashboard_columns ]); } ``` @@ -48,7 +48,7 @@ First add a function to generate the page: * `heading`: The title that will appear for this page * `model`: The model that will be accessed on this page * `rows`: A function returning an array containing the data to be shown on this page -* `cols`: Expects a variable called `$dashboard_columns` in the respective model that contains an array: +* `columns`: Expects a variable called `$dashboard_columns` in the respective model that contains an array: ```php public static $dashboard_columns = [ @@ -143,15 +143,7 @@ This function should be named the same as the one above except with `Edit` at th 'id' => $id, 'item' => $item, 'help_text' => 'NOTE: This is some help text for the current page', - 'columns' => [ - [ 'name' => 'venue', 'type' => 'text' ], - [ 'name' => 'date', 'type' => 'date' ], - [ 'name' => 'address', 'type' => 'text' ], - [ 'name' => 'phone', 'type' => 'text' ], - [ 'name' => 'website', 'type' => 'text' ], - [ 'name' => 'cover', 'type' => 'text' ], - [ 'name' => 'description', 'type' => 'mkd' ] - ] + 'columns' => $dashboard_columns ]); } ``` diff --git a/resources/views/dashboard/view.blade.php b/resources/views/dashboard/view.blade.php index d396212..4850f23 100644 --- a/resources/views/dashboard/view.blade.php +++ b/resources/views/dashboard/view.blade.php @@ -8,7 +8,7 @@ - @foreach($cols as $column) + @foreach($columns as $column) @endforeach @@ -17,7 +17,7 @@ @foreach($rows as $row) - @foreach($cols as $column) + @foreach($columns as $column) @endforeach
{{ $column[0] }}
{{ $column[0] }}: {{ $row[$column[1]] }}