PHPackages                             jayparmar271/cakephp-magic-query - 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. jayparmar271/cakephp-magic-query

ActiveCakephp-plugin

jayparmar271/cakephp-magic-query
================================

MagicQuery plugin for CakePHP

0.5.4(5y ago)1292[1 issues](https://github.com/JayParmar271/cakephp-magic-query/issues)MITPHP

Since Dec 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/JayParmar271/cakephp-magic-query)[ Packagist](https://packagist.org/packages/jayparmar271/cakephp-magic-query)[ RSS](/packages/jayparmar271-cakephp-magic-query/feed)WikiDiscussions master Synced 3d ago

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

MagicQuery plugin for CakePHP
=============================

[](#magicquery-plugin-for-cakephp)

[![Latest Stable Version](https://camo.githubusercontent.com/73cc23242507cbf984e84d49383f29f66fe50af3d66c5563fcfde1a81b9ba038/68747470733a2f2f706f7365722e707567782e6f72672f4a61795061726d61723237312f63616b657068702d6d616769632d71756572792f762f737461626c65)](https://packagist.org/packages/JayParmar271/cakephp-magic-query)[![Total Downloads](https://camo.githubusercontent.com/11fe8fa7f049f9a099e195ba0277f2ffaaa034acd6b427077b7025ba5de486dd/68747470733a2f2f706f7365722e707567782e6f72672f4a61795061726d61723237312f63616b657068702d6d616769632d71756572792f646f776e6c6f616473)](https://packagist.org/packages/JayParmar271/cakephp-magic-query)[![License](https://camo.githubusercontent.com/001deab3fa7edce308200575cc224e8e7b171df7f8a0dc2a10c89e0b84fa0620/68747470733a2f2f706f7365722e707567782e6f72672f4a61795061726d61723237312f63616b657068702d6d616769632d71756572792f6c6963656e7365)](https://packagist.org/packages/JayParmar271/cakephp-magic-query)[![Tests](https://github.com/JayParmar271/cakephp-magic-query/workflows/Run%20tests/badge.svg?branch=master)](https://github.com/JayParmar271/cakephp-magic-query/workflows/Run%20tests/badge.svg?branch=master)[![PHPStan Check](https://github.com/JayParmar271/cakephp-magic-query/workflows/Run%20PHPStan/badge.svg?branch=master)](https://github.com/JayParmar271/cakephp-magic-query/workflows/Run%20PHPStan/badge.svg?branch=master)[![Coding Style Check](https://github.com/JayParmar271/cakephp-magic-query/workflows/Coding%20Style/badge.svg?branch=master)](https://github.com/JayParmar271/cakephp-magic-query/workflows/Coding%20Style/badge.svg?branch=master)

Simple query builder made with CakePHP

Requirements
------------

[](#requirements)

- CakePHP 3.5+

Installation
------------

[](#installation)

You can install this plugin into your CakePHP application using [composer](https://getcomposer.org).

The recommended way to install composer packages is:

```
composer require jayparmar271/cakephp-magic-query

```

Usage
-----

[](#usage)

1. Add behavior in your table. (../src/Model/Table/UsersTable.php)

```
    $this->addBehavior('MagicQuery.Query');

```

2. Use getRecord() to get single record.

```
    $this->Users->getRecord(['name'], ['id' => '1']);

```

### To set default options:

[](#to-set-default-options)

1. Create new config file and add your default options. (/config/magic\_query.php)

```
return [
  'MagicQuery' => [
    'limit' => 2,
    'page' => 1,
    'orderBy' => ['id' => 'ASC'],
    'hydrate' => false,
    'validate' => true,
  ],
];
```

2. Load into your bootstrap.php (/config/bootstrap.php)

```
/*
 * Load magic query file
 */
if (file_exists(CONFIG . 'magic_query.php')) {
    Configure::load('magic_query');
}
```

That's all. Enjoy!

You can find more examples [here](EXAMPLES.md).

License
-------

[](#license)

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

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.2% of commits — single point of failure

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 ~2 days

Total

5

Last Release

1977d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/208ef99f7abf53f4258c9bf55774d3be904fa4bb6ca1610ad149b6f514bfb541?d=identicon)[jayparmar271](/maintainers/jayparmar271)

---

Top Contributors

[![JayParmar271](https://avatars.githubusercontent.com/u/25084128?v=4)](https://github.com/JayParmar271 "JayParmar271 (68 commits)")[![ishanvyas22](https://avatars.githubusercontent.com/u/17404636?v=4)](https://github.com/ishanvyas22 "ishanvyas22 (10 commits)")

---

Tags

cakephpcakephp-plugincakephp3php-packageplugincakephpcakephp3cakephp-plugincakephp4rapid-query

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jayparmar271-cakephp-magic-query/health.svg)

```
[![Health](https://phpackages.com/badges/jayparmar271-cakephp-magic-query/health.svg)](https://phpackages.com/packages/jayparmar271-cakephp-magic-query)
```

###  Alternatives

[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

338920.1k32](/packages/dereuromark-cakephp-tools)[dereuromark/cakephp-tinyauth

A CakePHP plugin to handle user authentication and authorization the easy way.

129228.6k10](/packages/dereuromark-cakephp-tinyauth)[bcrowe/cakephp-api-pagination

CakePHP 4 plugin that injects pagination information into API responses.

3953.5k1](/packages/bcrowe-cakephp-api-pagination)[dereuromark/cakephp-databaselog

A CakePHP plugin for storing and viewing application logs in the database

44165.0k2](/packages/dereuromark-cakephp-databaselog)[dereuromark/cakephp-setup

A CakePHP plugin containing lots of useful management tools

36162.8k2](/packages/dereuromark-cakephp-setup)[chrisshick/cakephp3-html-purifier

This is a CakePHP3 Purifier Plugin Behavior that cleanses data before it is marshalled into the entity.

12168.1k](/packages/chrisshick-cakephp3-html-purifier)

PHPackages © 2026

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