PHPackages                             cacing69/bitbuilder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. cacing69/bitbuilder

ActiveLibrary[Database &amp; ORM](/categories/database)

cacing69/bitbuilder
===================

Make easy query builder / eloquent queries based on requests for API Response

v0.3.5(4y ago)166↑1900%MITPHPPHP &gt;=7.0.0

Since Mar 17Pushed 4y ago1 watchersCompare

[ Source](https://github.com/cacing69/BITBuilder)[ Packagist](https://packagist.org/packages/cacing69/bitbuilder)[ RSS](/packages/cacing69-bitbuilder/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (7)Used By (0)

BITBuilder
==========

[](#bitbuilder)

### Make easy query builder / eloquent queries with requests for API Response on Laravel / Lumen

[](#make-easy-query-builder--eloquent-queries-with-requests-for-api-response-on-laravel--lumen)

This package has feature to filter, sort and include relations based on request. BITBuilder can be applied on Laravel's default Eloquent builder &amp; Query Builder. Query parameter names follow the [JSON API specification](https://jsonapi.org/).

Quick Installation
------------------

[](#quick-installation)

```
composer require cacing69/bitbuilder

```

How to use with eloquent
------------------------

[](#how-to-use-with-eloquent)

```
use App\Models\User;
use Cacing69\BITBuilder\FactoryBuilder;
use Cacing69\BITBuilder\Filterable;
use Cacing69\BITBuilder\Sortable;
...
public function index(Request $request)
{
	$factory = new FactoryBuilder();

	$data = $factory->on(User::class)
			->addFilters([
				// do filter on db based on request ex : url?filter[id]=1 will generate query where user_id = 1
				Filterable::exact("id", "user_id"), // fill second parameter, if u want to make alias on request

				// do filter on db based on request ex : url?filter[foo]=lorem
				Filterable::like("foo", "column_foo", Filterable::LIKE_BEGIN) // generate query where column_foo like "lorem%"
				// OR Filterable::like("fist_name", "user_first_name", Filterable::LIKE_END) // generate query where column_foo like "%lorem"
				// OR Filterable::like("fist_name", "user_first_name", Filterable::LIKE_BEGIN_END) // generate query where column_foo like "%lorem%"
			])
			->addSorts([
				Sortable::field('id', 'user_id') // will allow to sort via request url?sort_by=id (DESC), url?sort_by=-id (ASC)
			])
			->defaultSort("user_id") // will sort user by user_id DESC, u can use -user_id to make sort by ASC
			->limit(20) // add limitation u can call force to show all data with method $obj->showAllData(true);
			->with("media") // call eloquent relation
			->where("user_blocked", 1) // add wehre clause on User
			->setCursor("last_id"); // optional if u want to cursor pagination
			->get(); // u can paginate also there -> paginate(20);
}
```

How to use with query builder
-----------------------------

[](#how-to-use-with-query-builder)

```
use DB;
use Cacing69\BITBuilder\FactoryBuilder;
use Cacing69\BITBuilder\Filterable;
use Cacing69\BITBuilder\Sortable;
...
public function index(Request $request)
{
	$factory = new FactoryBuilder();

	$data = $factory->on(DB::table("t_user"))
			... // same as before
}
```

want to add more feature
------------------------

[](#want-to-add-more-feature)

You can help me fix the structure in this package, because I made this in a very short time for necessary purposes, any PR very welcome here, thank you

License
-------

[](#license)

The MIT License (MIT). Please see License File for more information.

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~33 days

Total

5

Last Release

1746d ago

PHP version history (2 changes)v0.1PHP &gt;=5.6.4

v0.3PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f1d7834c4d018cf15fa7b9ab0e4d944ddeccb4d7b1cc2a0611ccf975c507d5fe?d=identicon)[ibnuul](/maintainers/ibnuul)

---

Tags

laravellumeneloquentquery builder

### Embed Badge

![Health badge](/badges/cacing69-bitbuilder/health.svg)

```
[![Health](https://phpackages.com/badges/cacing69-bitbuilder/health.svg)](https://phpackages.com/packages/cacing69-bitbuilder)
```

###  Alternatives

[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[matchory/elasticsearch

The missing elasticsearch ORM for Laravel!

3059.0k](/packages/matchory-elasticsearch)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
