PHPackages                             coders/phind - 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. coders/phind

ActiveLibrary

coders/phind
============

Create, Ruin, Undo, Despair

0.1.0(7mo ago)12MITPHP

Since Oct 19Pushed 7mo agoCompare

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

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Phind
=====

[](#phind)

> Create, Ruin, Undo, Despair

A PHP library for data abstraction and query building that provides a unified interface for working with different data sources including SQL databases, NoSQL databases, and key-value stores.

Features
--------

[](#features)

- **Data Source Abstraction**: Support for multiple data sources (MySQL, NoSQL, Key-Value stores)
- **Query Builder**: Fluent interface for building complex queries
- **Collection Management**: Easy-to-use collection and entity management
- **Filtering &amp; Sorting**: Advanced filtering and sorting capabilities
- **Static Registry**: Centralized management of data sources and collections

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

[](#installation)

Install via Composer:

```
composer require coders/phind
```

Quick Start
-----------

[](#quick-start)

### Setting up a Data Source

[](#setting-up-a-data-source)

```
use Coders\Phind\Sources;
use Coders\Phind\Sources\SourceConfig;

// Create a MySQL data source
$config = new SourceConfig([
    'driver' => 'mysql',
    'host' => 'localhost',
    'database' => 'mydb',
    'username' => 'user',
    'password' => 'pass'
]);

$source = Sources::create('main', $config);
```

### Creating Collections

[](#creating-collections)

```
use Coders\Phind\Collections;

// Create collections for your entities
Collections::create($source, ['Users', 'Posts', 'Comments']);

// Get a collection
$users = Collections::get('Users');
```

### Working with Entities

[](#working-with-entities)

```
// Create a new entity
$user = $users->entity();
$user->name = 'John Doe';
$user->email = 'john@example.com';
$user->age = 30;

// Save the entity
$users->save($user);

// Retrieve entities by ID
$user = $users->get('user-id-123');
$multipleUsers = $users->get(['id1', 'id2', 'id3']);
```

### Building Queries

[](#building-queries)

```
use Coders\Phind\Query;
use Coders\Phind\Query\Filter;
use Coders\Phind\Query\SortAsc;
use Coders\Phind\Query\SortDesc;

// Create a query
$query = new Query('users');

// Add filters
$query->filter(new Filter('age', 18, Filter::GTE))
      ->filter(new Filter('status', 'active'));

// Add sorting
$query->sortBy(new SortAsc('name'))
      ->sortBy(new SortDesc('created_at'));

// Set limit and offset
$query->limit(10)
      ->offset(20);

// Select specific fields
$query->select(['id', 'name', 'email']);

// Execute the query
$results = $source->retrieve($query);
```

### Advanced Filtering

[](#advanced-filtering)

```
use Coders\Phind\Query\AndFilters;
use Coders\Phind\Query\OrFilters;

// Create complex filter groups
$ageFilter = new Filter('age', 18, Filter::GTE);
$statusFilter = new Filter('status', ['active', 'premium'], Filter::IN);

$orGroup = new OrFilters();
$orGroup->add($ageFilter)->add($statusFilter);

$query->filter($orGroup);
```

### Joining Queries

[](#joining-queries)

```
// Create related queries
$postsQuery = new Query('posts');
$postsQuery->filter(new Filter('published', true));

// Join with main query
$query->join($postsQuery);
```

Data Sources
------------

[](#data-sources)

The library supports multiple data source types:

- **MySQL**: SQL-based relational database
- **NoSQL**: Document-based databases
- **Key-Value**: Simple key-value stores
- **Chain**: Combine multiple data sources
- **StaticCache**: In-memory caching layer

Query Operations
----------------

[](#query-operations)

- **Filtering**: Equal, not equal, greater than, less than, in, not in
- **Sorting**: Ascending and descending order
- **Limiting**: Pagination support with limit and offset
- **Joining**: Combine data from multiple collections
- **Field Selection**: Choose specific fields to retrieve

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

[](#requirements)

- PHP 8.0 or higher
- Composer for dependency management

Development
-----------

[](#development)

### Running Tests

[](#running-tests)

```
./vendor/bin/phpunit tests/
```

### Code Style

[](#code-style)

```
./vendor/bin/php-cs-fixer fix
```

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

Author
------

[](#author)

**Irek Kubicki** -

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance65

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

211d ago

### Community

Maintainers

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

---

Top Contributors

[![ikubicki](https://avatars.githubusercontent.com/u/15101451?v=4)](https://github.com/ikubicki "ikubicki (1 commits)")

---

Tags

vibe-coding

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/coders-phind/health.svg)

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

PHPackages © 2026

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