From 650c0346b9798f8d8bdcec0ee45e369dcf46ede3 Mon Sep 17 00:00:00 2001 From: luanfreitasdev Date: Wed, 13 Mar 2024 18:52:50 -0300 Subject: [PATCH] Make laravel stable --- .github/workflows/sqlite.yml | 7 ++++++- composer.json | 2 +- src/DataSource/Builder.php | 7 ++----- src/ProcessDataSource.php | 4 +++- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/sqlite.yml b/.github/workflows/sqlite.yml index 4feaf1ad..05165e31 100644 --- a/.github/workflows/sqlite.yml +++ b/.github/workflows/sqlite.yml @@ -24,6 +24,11 @@ jobs: exclude: - php: 8.1 laravel: 11.* + include: + - laravel: 10.* + testbench: 8.* + - laravel: 11.* + testbench: 9.* dependency-version: [ prefer-stable ] name: PHP:${{ matrix.php }} / L:${{ matrix.laravel }} @@ -54,7 +59,7 @@ jobs: - name: Install Composer dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update composer install - name: Install openspout/openspout diff --git a/composer.json b/composer.json index 3d71b810..f360d818 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "PowerGrid generates Advanced Datatables using Laravel Livewire.", "homepage": "https://github.com/power-components/livewire-powergrid", "license": "MIT", - "minimum-stability": "dev", + "minimum-stability": "stable", "prefer-stable": true, "authors": [ { diff --git a/src/DataSource/Builder.php b/src/DataSource/Builder.php index 25aaa984..db49b91c 100644 --- a/src/DataSource/Builder.php +++ b/src/DataSource/Builder.php @@ -133,11 +133,8 @@ public function filterContains(): Builder $search = strtolower($search); $this->query = $this->query->where(function (EloquentBuilder|QueryBuilder $query) use ($search) { - if ($query instanceof QueryBuilder) { - $modelTable = $query->from; - } else { - $modelTable = $query->getModel()->getTable(); - } + /** @var string $modelTable */ + $modelTable = $query instanceof QueryBuilder ? $query->from : $query->getModel()->getTable(); $columnList = $this->getColumnList($modelTable); diff --git a/src/ProcessDataSource.php b/src/ProcessDataSource.php index 1ba8db0e..a7e50c58 100644 --- a/src/ProcessDataSource.php +++ b/src/ProcessDataSource.php @@ -322,7 +322,9 @@ private static function processBatch(BaseCollection $collection, PowerGridCompon protected function setCurrentTable(EloquentBuilder|array|BaseCollection|MorphToMany|Collection|QueryBuilder|null $datasource): void { if ($datasource instanceof QueryBuilder) { - $this->component->currentTable = $datasource->from; + /** @var string $from */ + $from = $datasource->from; + $this->component->currentTable = $from; return; }