From b8146c343365343b41029adfe71204f65ec33fb3 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 18:16:21 +0000 Subject: [PATCH 01/24] Initial Commit - Add Full Page Component Capability, Docs, Test --- CHANGELOG.md | 4 ++ docs/usage/creating-components.md | 61 +++++++++++++++++++ .../CustomisationsConfiguration.php | 57 +++++++++++++++++ src/Traits/Helpers/CustomisationsHelpers.php | 60 ++++++++++++++++++ src/Traits/WithCustomisations.php | 25 ++++++++ .../CustomisationsConfigurationTest.php | 40 ++++++++++++ 6 files changed, 247 insertions(+) create mode 100644 tests/Traits/Configuration/CustomisationsConfigurationTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 174f2a550..4ea0b8f69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `laravel-livewire-tables` will be documented in this file +## UNRELEASED +### New Features +- Add capability to use as a Full Page Component + ## [v3.1.4] - 2023-12-04 ### New Features - Add capability to hide Column Label by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1512 diff --git a/docs/usage/creating-components.md b/docs/usage/creating-components.md index b5173e2ca..a8e094ae0 100644 --- a/docs/usage/creating-components.md +++ b/docs/usage/creating-components.md @@ -3,6 +3,7 @@ title: Creating Components weight: 1 --- +### In-Line Component You can create components by using the [command](../start/commands) or copying from one of the [examples](../examples/basic-example). This is what a bare bones component looks like before your customization: @@ -38,3 +39,63 @@ class UsersTable extends DataTableComponent ``` Your component will extend the `Rappasoft\LaravelLivewireTables\DataTableComponent` class and at minimum implement 2 methods called [configure](./configuration) and [columns](../columns/creating-columns). + +### Full Page Component +To use a Table as a Full Page Component, there are a few options that you must set in your configure() method. + +#### setLayout +To use a Custom Layout (as a Full Page Component), use the setLayout() method, which expects to be passed a string which is the path to the layout. +```php + public function configure(): void + { + $this->setLayout('path-to-layout'); + } + +``` + +#### setSlot +To use a Custom Slot (as a Full Page Component), use setSlot() method, which expects to be passed a string which is the name of the slot. +```php + public function configure(): void + { + $this->setSlot('slot-name-here'); + } + +``` + +#### setSection +To use a Custom Section (as a Full Page Component), use setSection() method, which expects to be passed a string which is the name of the section. + + +#### Full Page Component Example +```php +setPrimaryKey('id') + ->setLayout('path-to-layout') + ->setSlot('slot-name-here'); + } + + public function columns(): array + { + return [ + Column::make('ID', 'id') + ->sortable(), + Column::make('Name') + ->sortable(), + ]; + } +} +``` diff --git a/src/Traits/Configuration/CustomisationsConfiguration.php b/src/Traits/Configuration/CustomisationsConfiguration.php index f16cf682a..88677bb3e 100644 --- a/src/Traits/Configuration/CustomisationsConfiguration.php +++ b/src/Traits/Configuration/CustomisationsConfiguration.php @@ -4,4 +4,61 @@ trait CustomisationsConfiguration { + + /** + * Used to set a Custom Layout if using a Full Page Component approach + * + * @param string $layout + * + * @return self + */ + public function setLayout(string $layout): self + { + $this->layout = $layout; + + return $this; + } + + /** + * Used to set a Custom Slot if using a Full Page Component approach + * + * @param string $slot + * + * @return self + */ + public function setSlot(string $slot): self + { + $this->slot = $slot; + + return $this; + } + + /** + * Used to set a Custom Extends Layout if using a Full Page Component approach + * + * @param string $layout + * + * @return self + */ + public function setExtends(string $layout): self + { + $this->extends = $layout; + + return $this; + } + + /** + * Used to set a Custom Layout Section if using a Full Page Component approach + * + * @param string $layout + * + * @return self + */ + public function setSection(string $section): self + { + $this->section = $section; + + return $this; + } + } diff --git a/src/Traits/Helpers/CustomisationsHelpers.php b/src/Traits/Helpers/CustomisationsHelpers.php index 5520ae5c7..e83af6ff4 100644 --- a/src/Traits/Helpers/CustomisationsHelpers.php +++ b/src/Traits/Helpers/CustomisationsHelpers.php @@ -4,4 +4,64 @@ trait CustomisationsHelpers { + + /** + * Used to determine if a Layout Extends has been defined - used when using as a Full Page Component + * + * @return bool + */ + public function hasExtends(): bool + { + return $this->extends !== null; + } + + public function getExtends() + { + return $this->extends; + } + + /** + * Used to determine if a Layout Section has been defined - used when using as a Full Page Component + * + * @return bool + */ + public function hasSection(): bool + { + return $this->section !== null; + } + + public function getSection() + { + return $this->section; + } + + /** + * Used to determine if a Layout Slot has been defined - used when using as a Full Page Component + * + * @return bool + */ + public function hasSlot(): bool + { + return $this->slot !== null; + } + + public function getSlot() + { + return $this->slot; + } + + /** + * Used to determine if a $layout has been defined - used when using as a Full Page Component + * + * @return bool + */ + public function hasLayout(): bool + { + return $this->layout !== null; + } + + public function getLayout() + { + return $this->layout; + } } diff --git a/src/Traits/WithCustomisations.php b/src/Traits/WithCustomisations.php index 556b5982d..d238613d4 100644 --- a/src/Traits/WithCustomisations.php +++ b/src/Traits/WithCustomisations.php @@ -10,6 +10,14 @@ trait WithCustomisations use CustomisationsConfiguration, CustomisationsHelpers; + protected ?string $layout = null; + + protected ?string $slot = null; + + protected ?string $extends = null; + + protected ?string $section = null; + /** * The view to add any modals for the table, could also be used for any non-visible html */ @@ -23,6 +31,23 @@ public function customView(): string */ public function renderingWithCustomisations(\Illuminate\View\View $view, array $data = []): void { + if ($this->hasLayout()){ + $view->layout($this->layout); + } + + if ($this->hasExtends()){ + $view->extends($this->extends); + } + + if ($this->hasSection()){ + $view->section($this->section); + } + + if ($this->hasSlot()){ + $view->slot($this->slot); + } + + $view = $view->with([ 'customView' => $this->customView(), ]); diff --git a/tests/Traits/Configuration/CustomisationsConfigurationTest.php b/tests/Traits/Configuration/CustomisationsConfigurationTest.php new file mode 100644 index 000000000..5ee1e3cf8 --- /dev/null +++ b/tests/Traits/Configuration/CustomisationsConfigurationTest.php @@ -0,0 +1,40 @@ +assertNull($this->basicTable->getExtends()); + $this->basicTable->setExtends('app.layout'); + $this->assertEquals('app.layout', $this->basicTable->getExtends()); + } + + /** @test */ + public function can_set_layout(): void + { + $this->assertNull($this->basicTable->getLayout()); + $this->basicTable->setLayout('app.layout'); + $this->assertEquals('app.layout', $this->basicTable->getLayout()); + } + + /** @test */ + public function can_set_section(): void + { + $this->assertNull($this->basicTable->getSection()); + $this->basicTable->setSection('content'); + $this->assertEquals('content', $this->basicTable->getSection()); + } + + /** @test */ + public function can_set_slot(): void + { + $this->assertNull($this->basicTable->getSlot()); + $this->basicTable->setSlot('my_slot'); + $this->assertEquals('my_slot', $this->basicTable->getSlot()); + } +} \ No newline at end of file From b73f0df28d601fa6bd05bbf65b454d11e7436ce7 Mon Sep 17 00:00:00 2001 From: lrljoe Date: Wed, 6 Dec 2023 18:16:49 +0000 Subject: [PATCH 02/24] Fix styling --- .../CustomisationsConfiguration.php | 20 +---- src/Traits/Helpers/CustomisationsHelpers.php | 9 --- src/Traits/WithCustomisations.php | 11 ++- .../CustomisationsConfigurationTest.php | 80 +++++++++---------- 4 files changed, 47 insertions(+), 73 deletions(-) diff --git a/src/Traits/Configuration/CustomisationsConfiguration.php b/src/Traits/Configuration/CustomisationsConfiguration.php index 88677bb3e..74420b00c 100644 --- a/src/Traits/Configuration/CustomisationsConfiguration.php +++ b/src/Traits/Configuration/CustomisationsConfiguration.php @@ -4,13 +4,8 @@ trait CustomisationsConfiguration { - /** * Used to set a Custom Layout if using a Full Page Component approach - * - * @param string $layout - * - * @return self */ public function setLayout(string $layout): self { @@ -21,10 +16,6 @@ public function setLayout(string $layout): self /** * Used to set a Custom Slot if using a Full Page Component approach - * - * @param string $slot - * - * @return self */ public function setSlot(string $slot): self { @@ -35,10 +26,6 @@ public function setSlot(string $slot): self /** * Used to set a Custom Extends Layout if using a Full Page Component approach - * - * @param string $layout - * - * @return self */ public function setExtends(string $layout): self { @@ -49,10 +36,8 @@ public function setExtends(string $layout): self /** * Used to set a Custom Layout Section if using a Full Page Component approach - * - * @param string $layout - * - * @return self + * + * @param string $layout */ public function setSection(string $section): self { @@ -60,5 +45,4 @@ public function setSection(string $section): self return $this; } - } diff --git a/src/Traits/Helpers/CustomisationsHelpers.php b/src/Traits/Helpers/CustomisationsHelpers.php index e83af6ff4..1c1f7d625 100644 --- a/src/Traits/Helpers/CustomisationsHelpers.php +++ b/src/Traits/Helpers/CustomisationsHelpers.php @@ -4,11 +4,8 @@ trait CustomisationsHelpers { - /** * Used to determine if a Layout Extends has been defined - used when using as a Full Page Component - * - * @return bool */ public function hasExtends(): bool { @@ -22,8 +19,6 @@ public function getExtends() /** * Used to determine if a Layout Section has been defined - used when using as a Full Page Component - * - * @return bool */ public function hasSection(): bool { @@ -37,8 +32,6 @@ public function getSection() /** * Used to determine if a Layout Slot has been defined - used when using as a Full Page Component - * - * @return bool */ public function hasSlot(): bool { @@ -52,8 +45,6 @@ public function getSlot() /** * Used to determine if a $layout has been defined - used when using as a Full Page Component - * - * @return bool */ public function hasLayout(): bool { diff --git a/src/Traits/WithCustomisations.php b/src/Traits/WithCustomisations.php index d238613d4..12ba77264 100644 --- a/src/Traits/WithCustomisations.php +++ b/src/Traits/WithCustomisations.php @@ -17,7 +17,7 @@ trait WithCustomisations protected ?string $extends = null; protected ?string $section = null; - + /** * The view to add any modals for the table, could also be used for any non-visible html */ @@ -31,23 +31,22 @@ public function customView(): string */ public function renderingWithCustomisations(\Illuminate\View\View $view, array $data = []): void { - if ($this->hasLayout()){ + if ($this->hasLayout()) { $view->layout($this->layout); } - if ($this->hasExtends()){ + if ($this->hasExtends()) { $view->extends($this->extends); } - if ($this->hasSection()){ + if ($this->hasSection()) { $view->section($this->section); } - if ($this->hasSlot()){ + if ($this->hasSlot()) { $view->slot($this->slot); } - $view = $view->with([ 'customView' => $this->customView(), ]); diff --git a/tests/Traits/Configuration/CustomisationsConfigurationTest.php b/tests/Traits/Configuration/CustomisationsConfigurationTest.php index 5ee1e3cf8..6ee063fd0 100644 --- a/tests/Traits/Configuration/CustomisationsConfigurationTest.php +++ b/tests/Traits/Configuration/CustomisationsConfigurationTest.php @@ -1,40 +1,40 @@ -assertNull($this->basicTable->getExtends()); - $this->basicTable->setExtends('app.layout'); - $this->assertEquals('app.layout', $this->basicTable->getExtends()); - } - - /** @test */ - public function can_set_layout(): void - { - $this->assertNull($this->basicTable->getLayout()); - $this->basicTable->setLayout('app.layout'); - $this->assertEquals('app.layout', $this->basicTable->getLayout()); - } - - /** @test */ - public function can_set_section(): void - { - $this->assertNull($this->basicTable->getSection()); - $this->basicTable->setSection('content'); - $this->assertEquals('content', $this->basicTable->getSection()); - } - - /** @test */ - public function can_set_slot(): void - { - $this->assertNull($this->basicTable->getSlot()); - $this->basicTable->setSlot('my_slot'); - $this->assertEquals('my_slot', $this->basicTable->getSlot()); - } -} \ No newline at end of file +assertNull($this->basicTable->getExtends()); + $this->basicTable->setExtends('app.layout'); + $this->assertEquals('app.layout', $this->basicTable->getExtends()); + } + + /** @test */ + public function can_set_layout(): void + { + $this->assertNull($this->basicTable->getLayout()); + $this->basicTable->setLayout('app.layout'); + $this->assertEquals('app.layout', $this->basicTable->getLayout()); + } + + /** @test */ + public function can_set_section(): void + { + $this->assertNull($this->basicTable->getSection()); + $this->basicTable->setSection('content'); + $this->assertEquals('content', $this->basicTable->getSection()); + } + + /** @test */ + public function can_set_slot(): void + { + $this->assertNull($this->basicTable->getSlot()); + $this->basicTable->setSlot('my_slot'); + $this->assertEquals('my_slot', $this->basicTable->getSlot()); + } +} From 2399e31947ba824faf991ede74fec048fda31201 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 18:25:52 +0000 Subject: [PATCH 03/24] Fix PHPDoc error --- src/Traits/Configuration/CustomisationsConfiguration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Traits/Configuration/CustomisationsConfiguration.php b/src/Traits/Configuration/CustomisationsConfiguration.php index 74420b00c..35c1a8e6a 100644 --- a/src/Traits/Configuration/CustomisationsConfiguration.php +++ b/src/Traits/Configuration/CustomisationsConfiguration.php @@ -5,7 +5,7 @@ trait CustomisationsConfiguration { /** - * Used to set a Custom Layout if using a Full Page Component approach + * Used to set a Custom Layout if using a Full Page Component approach. */ public function setLayout(string $layout): self { From fb91048844d962d388589e663e3f5a8bb5363068 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 18:27:59 +0000 Subject: [PATCH 04/24] Fix PHPDoc --- src/Traits/Configuration/CustomisationsConfiguration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Traits/Configuration/CustomisationsConfiguration.php b/src/Traits/Configuration/CustomisationsConfiguration.php index 35c1a8e6a..72e56d69a 100644 --- a/src/Traits/Configuration/CustomisationsConfiguration.php +++ b/src/Traits/Configuration/CustomisationsConfiguration.php @@ -37,7 +37,7 @@ public function setExtends(string $layout): self /** * Used to set a Custom Layout Section if using a Full Page Component approach * - * @param string $layout + * @param string $section */ public function setSection(string $section): self { From d147df9cd372760c776b8933bab1d8cb3da0a268 Mon Sep 17 00:00:00 2001 From: lrljoe Date: Wed, 6 Dec 2023 18:28:21 +0000 Subject: [PATCH 05/24] Fix styling --- src/Traits/Configuration/CustomisationsConfiguration.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Traits/Configuration/CustomisationsConfiguration.php b/src/Traits/Configuration/CustomisationsConfiguration.php index 72e56d69a..bccc39207 100644 --- a/src/Traits/Configuration/CustomisationsConfiguration.php +++ b/src/Traits/Configuration/CustomisationsConfiguration.php @@ -36,8 +36,6 @@ public function setExtends(string $layout): self /** * Used to set a Custom Layout Section if using a Full Page Component approach - * - * @param string $section */ public function setSection(string $section): self { From 683e647f78252593fe0a4457592bfbd597c67f89 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 18:40:20 +0000 Subject: [PATCH 06/24] Update WithCustomisations to use the has/get --- src/Traits/Configuration/CustomisationsConfiguration.php | 4 ++-- src/Traits/Helpers/CustomisationsHelpers.php | 8 ++++---- src/Traits/WithCustomisations.php | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Traits/Configuration/CustomisationsConfiguration.php b/src/Traits/Configuration/CustomisationsConfiguration.php index bccc39207..745ecdc9f 100644 --- a/src/Traits/Configuration/CustomisationsConfiguration.php +++ b/src/Traits/Configuration/CustomisationsConfiguration.php @@ -27,9 +27,9 @@ public function setSlot(string $slot): self /** * Used to set a Custom Extends Layout if using a Full Page Component approach */ - public function setExtends(string $layout): self + public function setExtends(string $extends): self { - $this->extends = $layout; + $this->extends = $extends; return $this; } diff --git a/src/Traits/Helpers/CustomisationsHelpers.php b/src/Traits/Helpers/CustomisationsHelpers.php index 1c1f7d625..05795fc1c 100644 --- a/src/Traits/Helpers/CustomisationsHelpers.php +++ b/src/Traits/Helpers/CustomisationsHelpers.php @@ -9,7 +9,7 @@ trait CustomisationsHelpers */ public function hasExtends(): bool { - return $this->extends !== null; + return isset($this->extends) && $this->extends !== null; } public function getExtends() @@ -22,7 +22,7 @@ public function getExtends() */ public function hasSection(): bool { - return $this->section !== null; + return isset($this->section) && $this->section !== null; } public function getSection() @@ -35,7 +35,7 @@ public function getSection() */ public function hasSlot(): bool { - return $this->slot !== null; + return isset($this->slot) && $this->slot !== null; } public function getSlot() @@ -48,7 +48,7 @@ public function getSlot() */ public function hasLayout(): bool { - return $this->layout !== null; + return isset($this->layout) && $this->layout !== null; } public function getLayout() diff --git a/src/Traits/WithCustomisations.php b/src/Traits/WithCustomisations.php index 12ba77264..d8b9c3d24 100644 --- a/src/Traits/WithCustomisations.php +++ b/src/Traits/WithCustomisations.php @@ -32,19 +32,19 @@ public function customView(): string public function renderingWithCustomisations(\Illuminate\View\View $view, array $data = []): void { if ($this->hasLayout()) { - $view->layout($this->layout); + $view->layout($this->getLayout()); } if ($this->hasExtends()) { - $view->extends($this->extends); + $view->extends($this->getExtends()); } if ($this->hasSection()) { - $view->section($this->section); + $view->section($this->getSection()); } if ($this->hasSlot()) { - $view->slot($this->slot); + $view->slot($this->getSlot()); } $view = $view->with([ From 325ad52eb622f8138845b13f8c5fed670e2030f9 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 18:42:25 +0000 Subject: [PATCH 07/24] Rename workflows to avoid clashes --- .github/workflows/run-tests-pcov-pull.yml | 2 +- .github/workflows/run-tests-pcov.yml | 2 +- .github/workflows/run-tests-pull.yml | 2 +- .github/workflows/run-tests.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-tests-pcov-pull.yml b/.github/workflows/run-tests-pcov-pull.yml index fbfdb8af2..cd9fece5a 100644 --- a/.github/workflows/run-tests-pcov-pull.yml +++ b/.github/workflows/run-tests-pcov-pull.yml @@ -13,7 +13,7 @@ jobs: laravel: [10] stability: [prefer-dist] - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} + name: PCOV - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} - PULL steps: - name: Checkout code diff --git a/.github/workflows/run-tests-pcov.yml b/.github/workflows/run-tests-pcov.yml index 1456d1cf1..f1f216241 100644 --- a/.github/workflows/run-tests-pcov.yml +++ b/.github/workflows/run-tests-pcov.yml @@ -13,7 +13,7 @@ jobs: laravel: [10] stability: [prefer-dist] - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} + name: PCOV - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} - PUSH steps: - name: Checkout code diff --git a/.github/workflows/run-tests-pull.yml b/.github/workflows/run-tests-pull.yml index 9c28ca24b..34e33bb09 100644 --- a/.github/workflows/run-tests-pull.yml +++ b/.github/workflows/run-tests-pull.yml @@ -13,7 +13,7 @@ jobs: laravel: [10] stability: [prefer-dist] - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} - PULL steps: - name: Checkout code diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5fb8a4359..5950435a8 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,7 +13,7 @@ jobs: laravel: [10] stability: [prefer-dist] - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} - PUSH steps: - name: Checkout code From 8fcb4eff2089aeb458457cd12b6cf5d4fb12a856 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 18:47:37 +0000 Subject: [PATCH 08/24] Update Cache Keys - Add PHP8.3 --- .github/workflows/run-tests-pcov-pull.yml | 4 ++-- .github/workflows/run-tests-pcov.yml | 4 ++-- .github/workflows/run-tests-pull.yml | 6 +++--- .github/workflows/run-tests.yml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/run-tests-pcov-pull.yml b/.github/workflows/run-tests-pcov-pull.yml index cd9fece5a..761b8b087 100644 --- a/.github/workflows/run-tests-pcov-pull.yml +++ b/.github/workflows/run-tests-pcov-pull.yml @@ -41,8 +41,8 @@ jobs: - uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer- + key: ${{ runner.os }}-PCOV-PULL-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-PCOV-PULL-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer- - name: Add token run: | diff --git a/.github/workflows/run-tests-pcov.yml b/.github/workflows/run-tests-pcov.yml index f1f216241..e168d999d 100644 --- a/.github/workflows/run-tests-pcov.yml +++ b/.github/workflows/run-tests-pcov.yml @@ -41,8 +41,8 @@ jobs: - uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer- + key: ${{ runner.os }}-PCOV-PUSH-PHP-${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-PCOV-PUSH-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer- - name: Add token run: | diff --git a/.github/workflows/run-tests-pull.yml b/.github/workflows/run-tests-pull.yml index 34e33bb09..dcb51b05c 100644 --- a/.github/workflows/run-tests-pull.yml +++ b/.github/workflows/run-tests-pull.yml @@ -9,7 +9,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: [8.1, 8.2] + php: [8.1, 8.2, 8.3] laravel: [10] stability: [prefer-dist] @@ -41,8 +41,8 @@ jobs: - uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer- + key: ${{ runner.os }}-PULL-PHP-${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-PULL-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer- - name: Add token run: | diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5950435a8..7bc2ab5d8 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,7 +9,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: [8.1, 8.2] + php: [8.1, 8.2, 8.3] laravel: [10] stability: [prefer-dist] From 9951d3524a834e8cd3f0640291edf11d64d0fc71 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 18:57:04 +0000 Subject: [PATCH 09/24] Workflow - Extension Caching for StdTests --- .github/workflows/run-tests-pcov-pull.yml | 4 ++-- .github/workflows/run-tests-pcov.yml | 4 ++-- .github/workflows/run-tests-pull.yml | 7 ++++-- .github/workflows/run-tests.yml | 28 +++++++++++++++++++---- 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/.github/workflows/run-tests-pcov-pull.yml b/.github/workflows/run-tests-pcov-pull.yml index 761b8b087..84ca1f24f 100644 --- a/.github/workflows/run-tests-pcov-pull.yml +++ b/.github/workflows/run-tests-pcov-pull.yml @@ -9,11 +9,11 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: [8.2] + php: [8.3] laravel: [10] stability: [prefer-dist] - name: PCOV - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} - PULL + name: PCOV - PULL - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} steps: - name: Checkout code diff --git a/.github/workflows/run-tests-pcov.yml b/.github/workflows/run-tests-pcov.yml index e168d999d..30b86a418 100644 --- a/.github/workflows/run-tests-pcov.yml +++ b/.github/workflows/run-tests-pcov.yml @@ -9,11 +9,11 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: [8.2] + php: [8.3] laravel: [10] stability: [prefer-dist] - name: PCOV - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} - PUSH + name: PCOV - PUSH - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} steps: - name: Checkout code diff --git a/.github/workflows/run-tests-pull.yml b/.github/workflows/run-tests-pull.yml index dcb51b05c..a2c10b8e8 100644 --- a/.github/workflows/run-tests-pull.yml +++ b/.github/workflows/run-tests-pull.yml @@ -13,7 +13,10 @@ jobs: laravel: [10] stability: [prefer-dist] - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} - PULL + name: STD TESTS - PULL - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} + env: + extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo steps: - name: Checkout code @@ -23,7 +26,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl, iconv, fileinfo + extensions: ${{ env.extensions }} tools: phpunit:latest ini-values: memory_limit=512M coverage: none diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 7bc2ab5d8..d5d5f016d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,17 +13,35 @@ jobs: laravel: [10] stability: [prefer-dist] - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} - PUSH + name: STD TESTS - PUSH - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} + env: + extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo steps: - name: Checkout code uses: actions/checkout@v3 - + + - name: Setup cache environment + id: extcache + uses: shivammathur/cache-extensions@v1 + with: + php-version: ${{ matrix.php }} + extensions: ${{ env.extensions }} + key: ${{ env.extensionKey }} + + - name: Cache extensions + uses: actions/cache@v3 + with: + path: ${{ steps.extcache.outputs.dir }} + key: ${{ steps.extcache.outputs.key }} + restore-keys: ${{ steps.extcache.outputs.key }} + - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl, iconv, fileinfo + extensions: ${{ env.extensions }} tools: phpunit:latest ini-values: memory_limit=512M coverage: none @@ -41,8 +59,8 @@ jobs: - uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer- + key: ${{ runner.os }}-PUSH-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-PUSH-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer- - name: Add token run: | From 6ad2096db0daba4ca3f09fc0141c1164a1e1d7cf Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 19:05:11 +0000 Subject: [PATCH 10/24] Update Workflow Jobs --- .github/workflows/run-tests-pcov-pull.yml | 13 ++++++++++++- .github/workflows/run-tests-pcov.yml | 22 ++++++++++++++++++++-- .github/workflows/run-tests-pull.yml | 22 +++++++++++++++++++--- .github/workflows/run-tests.yml | 5 +++-- 4 files changed, 54 insertions(+), 8 deletions(-) diff --git a/.github/workflows/run-tests-pcov-pull.yml b/.github/workflows/run-tests-pcov-pull.yml index 84ca1f24f..c9eb78324 100644 --- a/.github/workflows/run-tests-pcov-pull.yml +++ b/.github/workflows/run-tests-pcov-pull.yml @@ -14,16 +14,27 @@ jobs: stability: [prefer-dist] name: PCOV - PULL - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} + env: + extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}-withpcov + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pcov,pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo steps: - name: Checkout code uses: actions/checkout@v3 + + - name: Setup cache environment + id: extcache + uses: shivammathur/cache-extensions@v1 + with: + php-version: ${{ matrix.php }} + extensions: ${{ env.extensions }} + key: ${{ env.extensionKey }} - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl, iconv, fileinfo + extensions: ${{ env.extensions }} tools: phpunit:latest ini-values: memory_limit=512M coverage: pcov diff --git a/.github/workflows/run-tests-pcov.yml b/.github/workflows/run-tests-pcov.yml index 30b86a418..851fbf0b3 100644 --- a/.github/workflows/run-tests-pcov.yml +++ b/.github/workflows/run-tests-pcov.yml @@ -14,16 +14,34 @@ jobs: stability: [prefer-dist] name: PCOV - PUSH - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} + env: + extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}-withpcov + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pcov,pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo steps: - name: Checkout code uses: actions/checkout@v3 - + + - name: Setup cache environment + id: extcache + uses: shivammathur/cache-extensions@v1 + with: + php-version: ${{ matrix.php }} + extensions: ${{ env.extensions }} + key: ${{ env.extensionKey }} + + - name: Cache extensions + uses: actions/cache@v3 + with: + path: ${{ steps.extcache.outputs.dir }} + key: ${{ steps.extcache.outputs.key }} + restore-keys: ${{ steps.extcache.outputs.key }} + - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl, iconv, fileinfo + extensions: ${{ env.extensions }} tools: phpunit:latest ini-values: memory_limit=512M coverage: pcov diff --git a/.github/workflows/run-tests-pull.yml b/.github/workflows/run-tests-pull.yml index a2c10b8e8..6ca317977 100644 --- a/.github/workflows/run-tests-pull.yml +++ b/.github/workflows/run-tests-pull.yml @@ -6,6 +6,7 @@ jobs: test: runs-on: ${{ matrix.os }} strategy: + max-parallel: 1 fail-fast: false matrix: os: [ubuntu-latest] @@ -21,7 +22,22 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - + + - name: Setup cache environment + id: extcache + uses: shivammathur/cache-extensions@v1 + with: + php-version: ${{ matrix.php }} + extensions: ${{ env.extensions }} + key: ${{ env.extensionKey }} + + - name: Cache extensions + uses: actions/cache@v3 + with: + path: ${{ steps.extcache.outputs.dir }} + key: ${{ steps.extcache.outputs.key }} + restore-keys: ${{ steps.extcache.outputs.key }} + - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -44,8 +60,8 @@ jobs: - uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-PULL-PHP-${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-PULL-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer- + key: ${{ runner.os }}-STDPULL-PHP-${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-STDPULL-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer- - name: Add token run: | diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index d5d5f016d..fae03c122 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -6,6 +6,7 @@ jobs: test: runs-on: ${{ matrix.os }} strategy: + max-parallel: 1 fail-fast: false matrix: os: [ubuntu-latest] @@ -59,8 +60,8 @@ jobs: - uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-PUSH-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-PUSH-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer- + key: ${{ runner.os }}-STDPUSH-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-STDPUSH-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer- - name: Add token run: | From efb417338dfe0e88ee937bd70fe3d3d2d36a9248 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 19:10:03 +0000 Subject: [PATCH 11/24] Add ProcessIsolation --- phpunit.xml.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 5ff33415f..5bf2b587a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -5,6 +5,7 @@ colors="false" cacheResult="false" executionOrder="random" + processIsolation="true" failOnWarning="false" failOnRisky="false" failOnEmptyTestSuite="false" From 36f19786c47dbe615b3d529e094cf6e4a8937ca8 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 19:11:24 +0000 Subject: [PATCH 12/24] Remove beStrictAboutOutputDuringTests --- phpunit.xml.dist | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 5bf2b587a..72fe86b09 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -5,11 +5,10 @@ colors="false" cacheResult="false" executionOrder="random" - processIsolation="true" failOnWarning="false" failOnRisky="false" failOnEmptyTestSuite="false" - beStrictAboutOutputDuringTests="true" > + beStrictAboutOutputDuringTests="false" > tests From a0307c41fc51442d8add36e46494a394e25d430e Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 19:15:53 +0000 Subject: [PATCH 13/24] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ea0b8f69..0a57a9231 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ All notable changes to `laravel-livewire-tables` will be documented in this file ### New Features - Add capability to use as a Full Page Component +### Tweaks +- Internal - modify GitHub workflows to improve caching, but use unique caches per workflow + ## [v3.1.4] - 2023-12-04 ### New Features - Add capability to hide Column Label by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1512 From 4b602d54810b87c94ad6a70e2be4006c43d03cc6 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 19:30:27 +0000 Subject: [PATCH 14/24] Adjust workflows further --- .github/workflows/run-tests-pull.yml | 15 +++++---------- .github/workflows/run-tests.yml | 13 ++++++------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/.github/workflows/run-tests-pull.yml b/.github/workflows/run-tests-pull.yml index 6ca317977..2fffe9b62 100644 --- a/.github/workflows/run-tests-pull.yml +++ b/.github/workflows/run-tests-pull.yml @@ -6,18 +6,17 @@ jobs: test: runs-on: ${{ matrix.os }} strategy: - max-parallel: 1 fail-fast: false matrix: os: [ubuntu-latest] - php: [8.1, 8.2, 8.3] + php: [8.1, 8.2.12, 8.3] laravel: [10] stability: [prefer-dist] name: STD TESTS - PULL - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo steps: - name: Checkout code @@ -29,7 +28,7 @@ jobs: with: php-version: ${{ matrix.php }} extensions: ${{ env.extensions }} - key: ${{ env.extensionKey }} + key: ${{ runner.os }}-${{ env.extensionKey }} - name: Cache extensions uses: actions/cache@v3 @@ -60,8 +59,8 @@ jobs: - uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-STDPULL-PHP-${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-STDPULL-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer- + key: ${{ runner.os }}-STDPULL-PHP-${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-STDPULL-PHP-${{ matrix.php }}-L${{ matrix.laravel }}-composer- - name: Add token run: | @@ -72,11 +71,7 @@ jobs: run: composer require "laravel/framework:${{ matrix.laravel }}.*" --no-interaction --no-update - name: Update dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' run: composer update --${{ matrix.stability }} --no-interaction - - name: Setup problem matchers for PHPUnit - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Run Unit Tests run: php ./vendor/bin/paratest --no-coverage --processes=4 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index fae03c122..3ef9a6e54 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -6,18 +6,17 @@ jobs: test: runs-on: ${{ matrix.os }} strategy: - max-parallel: 1 fail-fast: false matrix: os: [ubuntu-latest] - php: [8.1, 8.2, 8.3] + php: [8.1, 8.2.12, 8.3] laravel: [10] stability: [prefer-dist] name: STD TESTS - PUSH - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo steps: - name: Checkout code @@ -35,8 +34,8 @@ jobs: uses: actions/cache@v3 with: path: ${{ steps.extcache.outputs.dir }} - key: ${{ steps.extcache.outputs.key }} - restore-keys: ${{ steps.extcache.outputs.key }} + key: ${{ runner.os }}-${{ steps.extcache.outputs.key }} + restore-keys: ${{ runner.os }}-${{ steps.extcache.outputs.key }} - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -60,8 +59,8 @@ jobs: - uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-STDPUSH-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-STDPUSH-PHP${{ matrix.php }}-Laravel${{ matrix.laravel }}-composer- + key: ${{ runner.os }}-STDPUSH-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-STDPUSH-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer- - name: Add token run: | From c6e1367e7d7d2ddfd77107314c096b3cab273c60 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 19:35:27 +0000 Subject: [PATCH 15/24] Update Composer - Require IlluminateSupport --- composer.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 512a01e8e..313df2d34 100644 --- a/composer.json +++ b/composer.json @@ -18,15 +18,17 @@ } ], "require": { - "php": "^8.1|^8.2", + "php": "^8.1|^8.2|^8.3", "blade-ui-kit/blade-heroicons": "^2.1", "illuminate/contracts": "^10.0|^11.0", + "illuminate/support": "^10.0|^11.0", "livewire/livewire": "^3.0|dev-main" }, "require-dev": { "ext-sqlite3": "*", "brianium/paratest": "^5.0|^6.0|^7.0|^8.0", "laravel/pint": "^1.10", + "monolog/monolog": "^1.0|^2.0", "nunomaduro/collision": "^6.0|^7.0|^8.0", "nunomaduro/larastan": "^2.6", "orchestra/testbench": "^7.0|^8.0|^9.0", From 1bf3268b2ae25ac2fa735660a41865e191c80b3d Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 19:36:36 +0000 Subject: [PATCH 16/24] Add Monolog to Composer --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 313df2d34..ef9c8b398 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "ext-sqlite3": "*", "brianium/paratest": "^5.0|^6.0|^7.0|^8.0", "laravel/pint": "^1.10", - "monolog/monolog": "^1.0|^2.0", + "monolog/monolog": "^1.0|^2.0|^3.0", "nunomaduro/collision": "^6.0|^7.0|^8.0", "nunomaduro/larastan": "^2.6", "orchestra/testbench": "^7.0|^8.0|^9.0", From 8ff56c6e763145a5a23ae274faa0b22603b5b855 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 19:36:52 +0000 Subject: [PATCH 17/24] Add Monolog --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ef9c8b398..10ae9c63e 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "ext-sqlite3": "*", "brianium/paratest": "^5.0|^6.0|^7.0|^8.0", "laravel/pint": "^1.10", - "monolog/monolog": "^1.0|^2.0|^3.0", + "monolog/monolog": "*", "nunomaduro/collision": "^6.0|^7.0|^8.0", "nunomaduro/larastan": "^2.6", "orchestra/testbench": "^7.0|^8.0|^9.0", From 6c0100b29c205683abe3d85337fafe0925316c4a Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 19:38:46 +0000 Subject: [PATCH 18/24] Add Dev --- .github/workflows/run-tests-pull.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests-pull.yml b/.github/workflows/run-tests-pull.yml index 2fffe9b62..68d505d5e 100644 --- a/.github/workflows/run-tests-pull.yml +++ b/.github/workflows/run-tests-pull.yml @@ -71,7 +71,7 @@ jobs: run: composer require "laravel/framework:${{ matrix.laravel }}.*" --no-interaction --no-update - name: Update dependencies - run: composer update --${{ matrix.stability }} --no-interaction + run: composer update --${{ matrix.stability }} --no-interaction --dev - name: Run Unit Tests run: php ./vendor/bin/paratest --no-coverage --processes=4 From da2a51259876bea2aa4e2afa8956f9565815b179 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 19:47:38 +0000 Subject: [PATCH 19/24] Update workflow usage --- .github/workflows/run-tests-pull.yml | 6 +++--- .github/workflows/run-tests.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-tests-pull.yml b/.github/workflows/run-tests-pull.yml index 68d505d5e..37a09a18a 100644 --- a/.github/workflows/run-tests-pull.yml +++ b/.github/workflows/run-tests-pull.yml @@ -9,7 +9,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: [8.1, 8.2.12, 8.3] + php: [8.1, 8.2, 8.3] laravel: [10] stability: [prefer-dist] @@ -44,7 +44,7 @@ jobs: extensions: ${{ env.extensions }} tools: phpunit:latest ini-values: memory_limit=512M - coverage: none + coverage: pcov env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -71,7 +71,7 @@ jobs: run: composer require "laravel/framework:${{ matrix.laravel }}.*" --no-interaction --no-update - name: Update dependencies - run: composer update --${{ matrix.stability }} --no-interaction --dev + run: composer update --${{ matrix.stability }} --no-interaction - name: Run Unit Tests run: php ./vendor/bin/paratest --no-coverage --processes=4 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 3ef9a6e54..de04f746f 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -44,7 +44,7 @@ jobs: extensions: ${{ env.extensions }} tools: phpunit:latest ini-values: memory_limit=512M - coverage: none + coverage: pcov env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 8fcfad706d292c8fba4ee6a1311a0b7446521444 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 20:20:42 +0000 Subject: [PATCH 20/24] Disable PSR Extension --- .github/workflows/run-tests-pcov.yml | 4 ++-- .github/workflows/run-tests-pull.yml | 4 ++-- .github/workflows/run-tests.yml | 4 ++-- tests/Traits/Visuals/ComponentVisualsTest.php | 6 ++---- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/run-tests-pcov.yml b/.github/workflows/run-tests-pcov.yml index 851fbf0b3..0386359e1 100644 --- a/.github/workflows/run-tests-pcov.yml +++ b/.github/workflows/run-tests-pcov.yml @@ -16,12 +16,12 @@ jobs: name: PCOV - PUSH - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}-withpcov - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pcov,pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pcov,pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr steps: - name: Checkout code uses: actions/checkout@v3 - + - name: Setup cache environment id: extcache uses: shivammathur/cache-extensions@v1 diff --git a/.github/workflows/run-tests-pull.yml b/.github/workflows/run-tests-pull.yml index 37a09a18a..81f34ddc6 100644 --- a/.github/workflows/run-tests-pull.yml +++ b/.github/workflows/run-tests-pull.yml @@ -16,7 +16,7 @@ jobs: name: STD TESTS - PULL - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr steps: - name: Checkout code @@ -44,7 +44,7 @@ jobs: extensions: ${{ env.extensions }} tools: phpunit:latest ini-values: memory_limit=512M - coverage: pcov + coverage: none env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index de04f746f..b57eb601d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -16,7 +16,7 @@ jobs: name: STD TESTS - PUSH - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr steps: - name: Checkout code @@ -44,7 +44,7 @@ jobs: extensions: ${{ env.extensions }} tools: phpunit:latest ini-values: memory_limit=512M - coverage: pcov + coverage: none env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/tests/Traits/Visuals/ComponentVisualsTest.php b/tests/Traits/Visuals/ComponentVisualsTest.php index 23d363525..8c07f47cf 100644 --- a/tests/Traits/Visuals/ComponentVisualsTest.php +++ b/tests/Traits/Visuals/ComponentVisualsTest.php @@ -6,10 +6,8 @@ use Illuminate\View\ViewException; use Livewire\Livewire; use Rappasoft\LaravelLivewireTables\Exceptions\DataTableConfigurationException; -use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\FailingTables\NoBuildMethodTable; -use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\FailingTables\NoPrimaryKeyTable; -use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\PetsTable; -use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\PetsTableAttributes; +use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\FailingTables\{NoBuildMethodTable, NoPrimaryKeyTable}; +use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\{PetsTable, PetsTableAttributes}; use Rappasoft\LaravelLivewireTables\Tests\TestCase; class ComponentVisualsTest extends TestCase From 4d1cebc21571fa06c23a78b87646066dd0af26ee Mon Sep 17 00:00:00 2001 From: lrljoe Date: Wed, 6 Dec 2023 20:21:04 +0000 Subject: [PATCH 21/24] Fix styling --- tests/Traits/Visuals/ComponentVisualsTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/Traits/Visuals/ComponentVisualsTest.php b/tests/Traits/Visuals/ComponentVisualsTest.php index 8c07f47cf..23d363525 100644 --- a/tests/Traits/Visuals/ComponentVisualsTest.php +++ b/tests/Traits/Visuals/ComponentVisualsTest.php @@ -6,8 +6,10 @@ use Illuminate\View\ViewException; use Livewire\Livewire; use Rappasoft\LaravelLivewireTables\Exceptions\DataTableConfigurationException; -use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\FailingTables\{NoBuildMethodTable, NoPrimaryKeyTable}; -use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\{PetsTable, PetsTableAttributes}; +use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\FailingTables\NoBuildMethodTable; +use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\FailingTables\NoPrimaryKeyTable; +use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\PetsTable; +use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\PetsTableAttributes; use Rappasoft\LaravelLivewireTables\Tests\TestCase; class ComponentVisualsTest extends TestCase From 0b7ac38f8844ec29dad49923506c449bd8a2a83e Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 20:27:31 +0000 Subject: [PATCH 22/24] Update workflows, Remove PHPStan ignoreErrors --- .github/workflows/run-tests-pcov-pull.yml | 2 +- .github/workflows/run-tests-pcov.yml | 2 +- .github/workflows/run-tests-pull.yml | 2 +- .github/workflows/run-tests.yml | 2 +- CHANGELOG.md | 1 + phpstan.neon | 4 ---- phpunit.xml.dist | 2 +- 7 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run-tests-pcov-pull.yml b/.github/workflows/run-tests-pcov-pull.yml index c9eb78324..387cc75f3 100644 --- a/.github/workflows/run-tests-pcov-pull.yml +++ b/.github/workflows/run-tests-pcov-pull.yml @@ -13,7 +13,7 @@ jobs: laravel: [10] stability: [prefer-dist] - name: PCOV - PULL - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} + name: PCOV-PULL - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}-withpcov extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pcov,pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo diff --git a/.github/workflows/run-tests-pcov.yml b/.github/workflows/run-tests-pcov.yml index 0386359e1..08f1ec574 100644 --- a/.github/workflows/run-tests-pcov.yml +++ b/.github/workflows/run-tests-pcov.yml @@ -13,7 +13,7 @@ jobs: laravel: [10] stability: [prefer-dist] - name: PCOV - PUSH - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} + name: PCOV-PUSH - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}-withpcov extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pcov,pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr diff --git a/.github/workflows/run-tests-pull.yml b/.github/workflows/run-tests-pull.yml index 81f34ddc6..0b53b11f8 100644 --- a/.github/workflows/run-tests-pull.yml +++ b/.github/workflows/run-tests-pull.yml @@ -13,7 +13,7 @@ jobs: laravel: [10] stability: [prefer-dist] - name: STD TESTS - PULL - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} + name: STD-PULL - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b57eb601d..b045c8b3d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,7 +13,7 @@ jobs: laravel: [10] stability: [prefer-dist] - name: STD TESTS - PUSH - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} + name: STD-PUSH - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a57a9231..a59ed9275 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to `laravel-livewire-tables` will be documented in this file ### Tweaks - Internal - modify GitHub workflows to improve caching, but use unique caches per workflow +- Internal - remove superfluous PHPStan ignoreErrors ## [v3.1.4] - 2023-12-04 ### New Features diff --git a/phpstan.neon b/phpstan.neon index 7366c08f3..5f80ea639 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -16,12 +16,8 @@ parameters: checkGenericClassInNonGenericObjectType: false ignoreErrors: - "#Unsafe usage of new static#" - - "#Called 'count' on Laravel collection, but could have been retrieved as a query.#" - - '#Attribute class Rappasoft\\LaravelLivewireTables\\Traits\\Url does not exist.#' - - '#Attribute class Rappasoft\\LaravelLivewireTables\\Traits\\Helpers\\On does not exist.#' - '#on array\, mixed\>\> in empty\(\) does not exist.#' - '#on array, mixed>> in isset\(\) does not exist#' - - '#on array\, mixed\>\> in isset\(\) does not exist#' - '#on non-empty-array<1|string, array, mixed>> in isset\(\) does not exist.#' - '#\$callback of method Illuminate\\Support\\Collection::filter\(\) expects \(callable\(string, int\): bool\)\|null, Closure\(mixed\): int<0, max> given.#' - '#Property Illuminate\\Database\\Query\\Builder\:\:\$joins \(array\) on left side of \?\? is not nullable.#' diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 72fe86b09..5ff33415f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,7 +8,7 @@ failOnWarning="false" failOnRisky="false" failOnEmptyTestSuite="false" - beStrictAboutOutputDuringTests="false" > + beStrictAboutOutputDuringTests="true" > tests From 50f13d4e7ed1b1a53957afaf391ffebe7b83bd6a Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 20:29:06 +0000 Subject: [PATCH 23/24] Update PHPStan to use PHP83 --- .github/workflows/run-phpstan.yml | 2 +- .github/workflows/run-tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-phpstan.yml b/.github/workflows/run-phpstan.yml index 094841e2c..a94ed2a24 100644 --- a/.github/workflows/run-phpstan.yml +++ b/.github/workflows/run-phpstan.yml @@ -9,7 +9,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.2] + php: [8.3] laravel: [10] stability: [prefer-dist] diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b045c8b3d..073bbe9c5 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,7 +9,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: [8.1, 8.2.12, 8.3] + php: [8.1, 8.2, 8.3] laravel: [10] stability: [prefer-dist] From d46265342d8a9bfd7dd25a936ac25e8d97f109e2 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 6 Dec 2023 20:29:45 +0000 Subject: [PATCH 24/24] Update Changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a59ed9275..b4cd109ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,9 @@ All notable changes to `laravel-livewire-tables` will be documented in this file - Add capability to use as a Full Page Component ### Tweaks -- Internal - modify GitHub workflows to improve caching, but use unique caches per workflow +- Internal - modify GitHub workflows to improve caching, but use unique caches per workflow matrix - Internal - remove superfluous PHPStan ignoreErrors +- Internal - update Test Suite to also test at PHP 8.3 ## [v3.1.4] - 2023-12-04 ### New Features