f-liva / eloquent-merge-select
Append selects to the existing ones exposing mergeSelect to the Eloquent Query Builder
Fund package maintenance!
Fliva
Requires
- php: ^8.1
- illuminate/contracts: ^9.0|^10.0|^11.0|^12.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.11
- laravel/pint: ^1.20
- nunomaduro/collision: ^7.12
- orchestra/testbench: ^8.36
- pestphp/pest: ^2.36
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.4
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^1.2
- phpstan/phpstan-phpunit: ^1.4
- spatie/laravel-ray: ^1.40
README
Add additional select columns to Eloquent queries without removing those already present.
Installation
You can install the package via composer:
composer require f-liva/eloquent-merge-select
Usage
User::query() ->select(['id', 'name']) ->mergeSelect(['email', 'created_at']) ->get(); // select `id`, `name`, `email`, `created_at` from `users`
Testing
composer pest
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.