diff --git a/README.md b/README.md index 283bcc8..dce2d2d 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,12 @@ Ginkelsoft DataTables is a flexible and easy-to-use package for managing tabular php artisan vendor:publish --provider="Ginkelsoft\\DataTables\\DataTableServiceProvider" --tag=views ``` +3. **Publish configuration file** (optional) for customization: + + ```bash + php artisan vendor:publish --provider="Ginkelsoft\DataTables\Providers\GinkelsoftDataTableServiceProvider" --tag=config + ``` + --- ## Usage With Livewire diff --git a/config/datatable.php b/config/datatable.php new file mode 100644 index 0000000..8dd59dd --- /dev/null +++ b/config/datatable.php @@ -0,0 +1,47 @@ + [ + 'active' => true, + 'options' => [10, 25, 50, 100], + 'default' => 10, + ], + + 'sort' => [ + 'active' => true, + 'column' => 'id', + 'direction' => 'asc', + ], + + 'columns' => [ + 'hidden' => [], + ], + + 'filters' => [ + 'active' => true, + ], + + 'row_actions' => [ + 'view' => 'datatable::row-actions', + ], + + 'bulk_actions' => [ + 'active' => true, + ], + + 'search' => [ + 'active' => true, + ], + +]; diff --git a/resources/views/vendor/datatables/components/page-result.blade.php b/resources/views/vendor/datatables/components/page-result.blade.php index 44bf63c..7b0c40d 100644 --- a/resources/views/vendor/datatables/components/page-result.blade.php +++ b/resources/views/vendor/datatables/components/page-result.blade.php @@ -1,10 +1,9 @@ diff --git a/resources/views/vendor/datatables/components/table.blade.php b/resources/views/vendor/datatables/components/table.blade.php index e2a643f..b21d9bb 100644 --- a/resources/views/vendor/datatables/components/table.blade.php +++ b/resources/views/vendor/datatables/components/table.blade.php @@ -2,7 +2,7 @@ - @if (count($bulkActions) > 0) + @if (config('datatable.bulk_actions.active') && count($bulkActions) > 0) - @if (count($bulkActions) > 0) + @if (config('datatable.bulk_actions.active') && count($bulkActions) > 0)