uteq / laravel-query-builder-macros
A set of common Laravel Uteq helpers and macros
Installs: 1 513
Dependents: 1
Suggesters: 0
Security: 0
Stars: 20
Watchers: 0
Forks: 1
Open Issues: 0
Requires
- php: ^8.0
- illuminate/support: ^8.71|^9.0|^10.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
README
Adds useful functionality to the Laravel Query Builder
Illuminate\Database\Query\Builder
.
Installation
composer require uteq/laravel-query-builder-macros
Or add the Uteq Laravel Support package
composer require uteq/laravel-support
rawQuery
$rawQuery = Account::query() ->where('email', 'john') ->getQuery() // You need to do this to get the rawQuery ->rawQuery(); // return `select * from "account" where "email" = 'john'`
ddQuery
Account::query() ->where('email', 'john') ->ddQuery(); // dd() of `select * from "account" where "email" = 'john'`
dumpQuery
Account::query() ->where('email', 'john') ->dumpQuery(); // dump() of `select * from "account" where "email" = 'john'` // the execution of the script will continue
rayQuery
Account::query() ->where('email', 'john') ->rayQuery(); // ray() of `select * from "account" where "email" = 'john'` // the execution of the script will continue
Inspiration by
Building this package I got inspired by the following:
- https://stackoverflow.com/a/53337416
- http://github.com/spatie/laravel-collection-macros
- https://github.com/spatie/package-skeleton-laravel
Credits
Testing
$ composer test
About Uteq
We are a web development agency based in the Netherlands. We design and build web applications for our clients. We are specialized in Laravel with Livewire.
License
The MIT License (MIT). Please see License File for more information.