diff --git a/app/Filters/ClientFilters.php b/app/Filters/ClientFilters.php index 5fae1e910955..19642f1c259b 100644 --- a/app/Filters/ClientFilters.php +++ b/app/Filters/ClientFilters.php @@ -18,6 +18,7 @@ use Illuminate\Database\Eloquent\Builder; */ class ClientFilters extends QueryFilters { + /** * Filter by name. * diff --git a/app/Filters/QueryFilters.php b/app/Filters/QueryFilters.php index 818af708a52c..e207a8052264 100644 --- a/app/Filters/QueryFilters.php +++ b/app/Filters/QueryFilters.php @@ -293,8 +293,16 @@ abstract class QueryFilters return $this->builder; } - public function with(string $value): Builder + public function with(string $value = ''): Builder { + if (strlen($value) == 0) { + return $this->builder; + } + + if($this->with_property == 'id') { + $value = $this->decodePrimaryKey($value); + } + return $this->builder ->orWhere($this->with_property, $value) ->orderByRaw("{$this->with_property} = ? DESC", [$value]) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index d0f17d0a170c..7faeaf96b82d 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -40,15 +40,15 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { - // DB::listen(function($query) { - // nlog( - // $query->sql, - // [ - // 'bindings' => $query->bindings, - // 'time' => $query->time - // ] - // ); - // }); + \DB::listen(function($query) { + nlog( + $query->sql, + [ + 'bindings' => $query->bindings, + 'time' => $query->time + ] + ); + }); // Model::preventLazyLoading( // !$this->app->isProduction() diff --git a/phpstan.neon b/phpstan.neon index c6be40ce7139..e426a63268c0 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -4,8 +4,8 @@ includes: parameters: ignoreErrors: - '#Call to an undefined method .*badMethod\(\)#' - - 'Call to an undefined method Illuminate\Database\Eloquent\Builder::exclude(). - level: 2 + - '#Call to an undefined method Illuminate\Database\Eloquent\Builder::exclude#' + level: 4 paths: - app universalObjectCratesClasses: diff --git a/tests/Feature/EInvoice/FacturaeTest.php b/tests/Feature/EInvoice/FacturaeTest.php index 9f0f393e0398..3085d4221b18 100644 --- a/tests/Feature/EInvoice/FacturaeTest.php +++ b/tests/Feature/EInvoice/FacturaeTest.php @@ -9,7 +9,7 @@ * @license https://www.elastic.co/licensing/elastic-license */ -namespace Tests\Feature; +namespace Tests\Feature\EInvoice; use App\Services\Invoice\EInvoice\FacturaEInvoice; use Illuminate\Foundation\Testing\DatabaseTransactions; @@ -19,7 +19,6 @@ use Tests\TestCase; /** * @test - * @covers App\Http\Controllers\ActivityController */ class FacturaeTest extends TestCase { diff --git a/tests/Feature/EInvoice/FatturaPATest.php b/tests/Feature/EInvoice/FatturaPATest.php index 2c76c1ca510c..11e1ccdee0bb 100644 --- a/tests/Feature/EInvoice/FatturaPATest.php +++ b/tests/Feature/EInvoice/FatturaPATest.php @@ -9,7 +9,7 @@ * @license https://www.elastic.co/licensing/elastic-license */ -namespace Tests\Feature; +namespace Tests\Feature\EInvoice; use App\Services\Invoice\EInvoice\FatturaPA; use Illuminate\Foundation\Testing\DatabaseTransactions; diff --git a/tests/Feature/Export/ArDetailReportTest.php b/tests/Feature/Export/ArDetailReportTest.php index 8f523a52c551..0c196685290d 100644 --- a/tests/Feature/Export/ArDetailReportTest.php +++ b/tests/Feature/Export/ArDetailReportTest.php @@ -19,7 +19,6 @@ use App\Models\Company; use App\Models\Invoice; use App\Models\User; use App\Services\Report\ARDetailReport; -use App\Services\Report\UserSalesReport; use App\Utils\Traits\MakesHash; use Illuminate\Routing\Middleware\ThrottleRequests; use Tests\MockAccountData; @@ -28,7 +27,7 @@ use Tests\TestCase; /** * @test */ -class ARDetailReportTest extends TestCase +class ArDetailReportTest extends TestCase { use MakesHash; diff --git a/tests/Feature/Export/ArSummaryReportTest.php b/tests/Feature/Export/ArSummaryReportTest.php index bf797b643d29..dffde40f87a9 100644 --- a/tests/Feature/Export/ArSummaryReportTest.php +++ b/tests/Feature/Export/ArSummaryReportTest.php @@ -27,7 +27,7 @@ use Tests\TestCase; /** * @test */ -class ARSummaryReportTest extends TestCase +class ArSummaryReportTest extends TestCase { use MakesHash;