{"repo":"protonemedia/laravel-eloquent-scope-as-select","free":true,"listed":false,"github":"https://github.com/protonemedia/laravel-eloquent-scope-as-select","clone":"git clone https://github.com/protonemedia/laravel-eloquent-scope-as-select.git","description":"Stop duplicating your Eloquent query scopes and constraints in PHP. This package lets you re-use your query scopes and constraints by adding them as a subquery.","language":"PHP","stars":143,"topics":["laravel","php","subquery","laravel-packages"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Laravel Eloquent Scope as Select Stop duplicating your Eloquent query scopes and constraints in PHP. This package lets you re-use your query scopes and constraints by adding them as a subquery. 📺 Want to see this package in action? Join the live stream on December 3 at 14:00 CET: https://youtu.be/0vR8IQSFsfQ Requirements PHP 8.2+ Laravel 11.0 This package is tested with GitHub Actions using MySQL 8.0, PostgreSQL 10.8 and SQLite. Features Add a subquery based on a query scope. Add a subquery using a Closure. Shortcuts for calling scopes by using a string or array. Support for more than one subquery. Support for flipping the result. Zero third-party dependencies. Related package: Laravel Eloquent Where Not Sponsor Us ❤️ We proudly support the community by developing Laravel packages and giving them away for free. If this package saves you time or if you're relying on it professionally, please consider sponsoring the maintenance and development and check out our latest premium package: Inertia Table. Keeping track of issues and pull requests takes time, but we're happy to help! Blogpost If you want to know more about the background of this package, please read the blogpost: Stop duplicating your Eloquent query scopes and constraints. Re-use them as select statements with a new Laravel package. Installation You can install the package via composer: Add the macro to the query builder, for example, in your AppServiceProvider . By default, the name of the macro is addScopeAsSelect ","default_branch":null,"files":null,"tree":[],"storefront":"/r/protonemedia","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/protonemedia/laravel-eloquent-scope-as-select/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}