guanguans/laravel-soar
SQL optimizer and rewriter for laravel. - laravel į SQL äŧåå¨åéåå¨ã
Maintainers
Fund package maintenance!
6.0.1
2026-04-02 08:07 UTC
Requires
- php: >=8.2
- guanguans/soar-php: ^8.0
- laravel/framework: ^11.51 || ^12.0 || ^13.0
Requires (Dev)
- adamwojs/php-cs-fixer-phpdoc-force-fqcn: ^2.0
- bamarni/composer-bin-plugin: ^1.9
- brainmaestro/composer-git-hooks: ^3.0
- canvural/larastan-strict-rules: ^3.0
- driftingly/rector-laravel: ^2.2
- ergebnis/composer-normalize: ^2.50
- ergebnis/license: ^2.7
- ergebnis/php-cs-fixer-config: ^6.60
- ergebnis/phpstan-rules: ^2.13
- ergebnis/rector-rules: ^1.15
- fruitcake/laravel-debugbar: ^4.2
- guanguans/monorepo-builder-worker: ^3.1
- guanguans/php-cs-fixer-custom-fixers: ^1.2
- guanguans/phpstan-rules: ^1.1
- guanguans/rector-rules: ^1.7
- itsgoingd/clockwork: ^5.3
- jbelien/phpstan-sarif-formatter: ^1.2
- laradumps/laradumps: ^5.3
- larastan/larastan: ^3.9
- laravel/facade-documenter: dev-main
- laravel/telescope: ^5.19
- mockery/mockery: ^1.6
- mrpunyapal/peststan: ^0.2
- mrpunyapal/rector-pest: ^0.2
- nette/utils: ^4.1
- nicksdot/phpstan-phpstorm-error-identifiers: ^0.3
- orchestra/testbench: ^9.17 || ^10.0 || ^11.0
- pestphp/pest: ^3.8 || ^4.0
- pestphp/pest-plugin-arch: ^3.1 || ^4.0
- pestphp/pest-plugin-laravel: ^3.2 || ^4.0
- php-mock/php-mock-phpunit: ^2.15
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-mockery: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpstan/phpstan-webmozart-assert: ^2.0
- phpunit/phpunit: ^11.5 || ^12.0 || ^13.0
- povils/phpmnd: ^3.6
- rector/argtyper: ^0.6
- rector/jack: ^0.5
- rector/swiss-knife: ^2.3
- rector/type-perfect: ^2.1
- roave/backward-compatibility-check: ^8.14
- roave/no-floaters: ^1.13
- shipmonk/composer-dependency-analyser: ^1.8
- shipmonk/dead-code-detector: ^0.15
- shipmonk/name-collision-detector: ^2.1
- shipmonk/phpstan-baseline-per-identifier: ^2.3
- shipmonk/phpstan-rules: ^4.3
- sidz/phpstan-rules: ^0.5
- spatie/invade: ^2.1
- spatie/laravel-image-optimizer: ^1.8
- spatie/laravel-ray: ^1.43
- spaze/phpstan-disallowed-calls: ^4.9
- staabm/annotate-pull-request-from-checkstyle: ^1.8
- staabm/phpstan-todo-by: ^0.3
- staabm/side-effects-detector: ^1.0
- symfony/thanks: ^1.4
- symplify/coding-standard: ^13.0
- symplify/easy-coding-standard: ^13.0
- symplify/phpstan-rules: ^14.9
- tomasvotruba/class-leak: ^2.1
- tomasvotruba/cognitive-complexity: ^1.1
- tomasvotruba/ctor: ^2.2
- tomasvotruba/type-coverage: ^2.1
- tomasvotruba/unused-public: ^2.2
- yamadashy/phpstan-friendly-formatter: ^1.4
Suggests
- buggregator/trap: Output SQL scores to Trap.
- fruitcake/laravel-debugbar: Output SQL scores to Laravel DebugBar.
- itsgoingd/clockwork: Output SQL scores to Clockwork.
- laradumps/laradumps: Output SQL scores to Laradumps.
- laravel/telescope: Output SQL scores to Telescope.
- spatie/laravel-ray: Output SQL scores to Laravel Ray.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-06-24 14:38:35 UTC
README
| đ Image |
đ Image |
|---|
laravel-soar
SQL optimizer and rewriter for laravel. - laravel į SQL äŧåå¨åéåå¨ã
đ tests
đ php-cs-fixer
đ codecov
đ Latest Stable Version
đ GitHub release (with filter)
đ Total Downloads
đ License
Features
- Supports heuristic rule suggestions, index rule suggestions, and
EXPLAINinformation interpretation - Support calling query builder
Mixinmethods for convenient dumping of rule suggestions - Automatically monitor output rule suggestions to configured outputs
Related Links
Requirement
- PHP >= 8.2
Installation
composer require guanguans/laravel-soar --dev --ansi -v
Configuration
Publish files(optional)
php artisan vendor:publish --provider="Guanguans\\LaravelSoar\\SoarServiceProvider"
â ī¸ When running in a unix OS non-cli environment, may throw Fatal error: ...Exit Code: 2(Misuse of shell builtins)
Configure sudo password
# Fatal error: Uncaught Guanguans\SoarPHP\Exceptions\ProcessFailedException: The command "'/Users/yaozm/Documents/develop/soar-php/bin/soar.darwin-amd64' '-report-type=json' '-query=select * from users;'" failed. Exit Code: 2(Misuse of shell builtins) Working directory: /Users/yaozm/Documents/develop/soar-php Output: ================ Error Output: ================ panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1938665] goroutine 1 [running]: github.com/pingcap/tidb/util/memory.MemTotalNormal() pkg/mod/github.com/pingcap/tidb@v1.1.0-beta.0.20210601085537-5d7c852770eb/util/memory/meminfo.go:41 +0x65 github.com/pingcap/tidb/util/memory.init.0() pkg/mod/github.com/pingcap/tidb@v1.1.0-beta.0.20210601085537-5d7c852770eb/util/memory/meminfo.go:134 +0x175 in /Users/yaozm/Documents/develop/soar-php/src/Concerns/WithRunable.php:36 Stack trace: #0 /Users/yaozm/Documents/develop/soar-php/test.php(163): Guanguans\SoarPHP\Soar->run() #1 /User in /Users/yaozm/Documents/develop/soar-php/src/Concerns/WithRunable.php on line 36 SOAR_SUDO_PASSWORD='your sudo password' # Set a sudo password to run the soar command with sudo to avoid the above errors.
Or configure sudoers
Usage
Enable to automatically output SQL optimization suggestions
Install and configure outputs(optional)
Soar commands
Soar facade and methods
Methods of the query builder Mixin
Composer scripts
composer checks:required
composer php-cs-fixer:fix
composer test
composer testbench soar:run
composer testbench soar:score
composer testbench:serve
composer testbench:test
composer testbench:user-serve
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
