f-liva/eloquent-merge-select

Append selects to the existing ones exposing mergeSelect to the Eloquent Query Builder

v1.0.0 2025-08-27 09:48 UTC

This package is auto-updated.

Last update: 2025-08-27 17:40:15 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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.