Package Data | |
---|---|
Maintainer Username: | chiragardeshna |
Maintainer Contact: | ardeshnachirag@gmail.com (Chirag Ardeshna) |
Package Create Date: | 2017-08-09 |
Package Last Update: | 2017-08-10 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-23 03:05:28 |
Package Statistics | |
---|---|
Total Downloads: | 10 |
Monthly Downloads: | 1 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
It extends laravel \ lumen default Query builder.
composer require chiragardeshna/dbextender
Run php artisan vendor:publish. Put Chiragardeshna\Dbextender\DBExtenderServiceProvider::class in config/app.php in providers array.
Create dbextender.php file and put it in config/dbextender.php.
dbextender.php
<?php
return [
/*
|--------------------------------------------------------------------------
| Query Builder
|--------------------------------------------------------------------------
|
| Here you can specify a class which extends default Illuminate\Database\Query\Builder.
| It's important that specified class extend behaviour from default Query Builder class.
|
*/
'builder' => 'App\Query\Builder',
];
Register this new config file in bootstrap/app.php.
$app->register(Chiragardeshna\Dbextender\DBExtenderServiceProvider::class); $app->configure('dbextender');
Create app/query/Builder.php file
<?php
namespace App\Query;
use Illuminate\Database\Query\Builder as QueryBuilder;
class Builder extends QueryBuilder
{
// put your methods here.
}
And that's it enjoy.