sfneal / builders
Eloquent\Builder wrapper with extended functionality
Installs: 6 875
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.3
- illuminate/database: >=8.2
- sfneal/string-helpers: >=1.0.1
Requires (Dev)
- laravel/legacy-factories: >=1.1.0
- orchestra/testbench: >=6.7
- phpunit/phpunit: >=7.5.20
README
Eloquent\Builder wrapper with extended functionality.
Installation
You can install the package via composer:
composer require sfneal/builders
Usage
Add the custom QueryBuilder to any Eloquent model by overwriting the built-in newEloquentBuilder() & query() methods.
use Illuminate\Database\Eloquent\Builder; use Sfneal\Builders\QueryBuilder; class ExampleModel extends Model { /** * Query Builder. * * @param $query * @return QueryBuilder */ public function newEloquentBuilder($query) { return new QueryBuilder($query); } /** * Query Builder method for improved type hinting. * * @return QueryBuilder|Builder */ public static function query() { return parent::query(); } }
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email stephen.neal14@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
PHP Package Boilerplate
This package was generated using the PHP Package Boilerplate.