diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ac144e..c94621b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [5.0.1](https://github.com/Okipa/laravel-table/compare/5.0.0...5.0.1) + +2022-09-26 + +* Fixed `make:table --model=` command + ## [5.0.0](https://github.com/Okipa/laravel-table/compare/4.0.4...5.0.0) 2022-09-21 diff --git a/src/Console/Commands/stubs/table.model.stub b/src/Console/Commands/stubs/table.model.stub index 92080ca..079e424 100644 --- a/src/Console/Commands/stubs/table.model.stub +++ b/src/Console/Commands/stubs/table.model.stub @@ -4,6 +4,7 @@ namespace DummyNamespace; use DummyFullModelClass; use Okipa\LaravelTable\Table; +use Okipa\LaravelTable\Column; use Okipa\LaravelTable\RowActions\EditRowAction; use Okipa\LaravelTable\RowActions\DestroyRowAction; use Okipa\LaravelTable\Formatters\DateFormatter; @@ -23,9 +24,9 @@ class DummyClass extends AbstractTableConfiguration protected function columns(): array { return [ - Column::make('id')->sortable(); - Column::make('created_at')->format(new DateFormatter('d/m/Y H:i'))->sortable(); - Column::make('updated_at')->format(new DateFormatter('d/m/Y H:i'))->sortable()->sortByDefault('desc'); + Column::make('id')->sortable(), + Column::make('created_at')->format(new DateFormatter('d/m/Y H:i'))->sortable(), + Column::make('updated_at')->format(new DateFormatter('d/m/Y H:i'))->sortable()->sortByDefault('desc'), ]; } diff --git a/tests/Unit/MakeTest.php b/tests/Unit/MakeTest.php index fd4378a..0d9f125 100644 --- a/tests/Unit/MakeTest.php +++ b/tests/Unit/MakeTest.php @@ -62,6 +62,7 @@ public function it_can_make_table_with_model_option(): void 'namespace App\Tables;', 'use App\Models\User;', 'use Okipa\LaravelTable\Abstracts\AbstractTableConfiguration;', + 'use Okipa\LaravelTable\Column;', 'use Okipa\LaravelTable\Formatters\DateFormatter;', 'use Okipa\LaravelTable\RowActions\DestroyRowAction;', 'use Okipa\LaravelTable\RowActions\EditRowAction;', @@ -79,9 +80,9 @@ public function it_can_make_table_with_model_option(): void 'protected function columns(): array', '{', 'return [', - 'Column::make(\'id\')->sortable();', - 'Column::make(\'created_at\')->format(new DateFormatter(\'d/m/Y H:i\'))->sortable();', - 'Column::make(\'updated_at\')->format(new DateFormatter(\'d/m/Y H:i\'))->sortable()->sortByDefault(\'desc\');', + 'Column::make(\'id\')->sortable(),', + 'Column::make(\'created_at\')->format(new DateFormatter(\'d/m/Y H:i\'))->sortable(),', + 'Column::make(\'updated_at\')->format(new DateFormatter(\'d/m/Y H:i\'))->sortable()->sortByDefault(\'desc\'),', '];', '}', 'protected function results(): array',