PHPackages                             joao-prrvz/php-utils - 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. joao-prrvz/php-utils

ActiveLibrary

joao-prrvz/php-utils
====================

A small library made for a active record and schemas validation based workflow

0.0.6(1mo ago)032↓100%CC-BY-NC-4.0PHPPHP &gt;=8.1

Since Jan 27Pushed 1mo agoCompare

[ Source](https://github.com/JoaoPRRVZ/PHPUtils)[ Packagist](https://packagist.org/packages/joao-prrvz/php-utils)[ RSS](/packages/joao-prrvz-php-utils/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (7)Used By (0)

PHPUtils
========

[](#phputils)

A small library made for a active record and schemas validation based workflow

Examples
--------

[](#examples)

### Model exmaples

[](#model-exmaples)

```
use PHPUtils\BaseModel;
use PHPUtils\Attributes\DB as DB;

class User extends BaseModel {
	// Block makes it so when generating the insert and update query it will not add the column "id" to the sql query
	#[DB\Column, DB\Block(DB\Block::INSERT, DB\Block::UPDATE)]
	public int $id;
    #[DB\Column]
	public string $username;
    #[DB\Column]
	public string $email;
	// Hidden makes it so when we do json_encode on this model it will not return the password
    #[DB\Column, DB\Hidden]
	public string $password;

	public static function selectById(int $id): User {
		return static::selectBy("id", $id);
	}

	public function insert(): int {
		$sql = static::getInsertQuery();
		$params = [
			$this->username,
			$this->email,
			$this->password,
		];
		static::run($sql, $params);
		return static::getDB()->lastInsertId();
	}

	public function update(): void {
		$params = [
			$this->username,
			$this->email,
			$this->password,
		];
		parent::updateBy("id", $this->id, $params);
	}

	public function delete(): void {
		parent::deleteBy("id", $this->id);
	}
}

// Select all is already created on BaseModel
User::selectAll();
```

### Schema examples

[](#schema-examples)

```
use PHPUtils\BaseSchema;
use PHPUtils\Attributes\Property;
use PHPUtils\Attributes\Validators as VA;

class User extends BaseSchema {
    #[Property, VA\Min(3), VA\Max(10), VA\Filter(FILTER_SANITIZE_FULL_SPECIAL_CHARS)]
    public string $username;
    #[Property, VA\Filter(FILTER_VALIDATE_EMAIL)]
    public string $email;
    #[Property, VA\Min(8), VA\Max(20)]
    public string $password;
}
$data = [
    "username" => "My username",
    "email" => "wrongemail",
    "password" => "password",
];

$schema = new User($data);

$result = $schema->validate();
```

###  Health Score

37

—

LowBetter than 84% of packages

Maintenance91

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

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

Every ~2 days

Total

6

Last Release

41d ago

### Community

Maintainers

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

---

Top Contributors

[![JoaoPRRVZ](https://avatars.githubusercontent.com/u/257588336?v=4)](https://github.com/JoaoPRRVZ "JoaoPRRVZ (11 commits)")

### Embed Badge

![Health badge](/badges/joao-prrvz-php-utils/health.svg)

```
[![Health](https://phpackages.com/badges/joao-prrvz-php-utils/health.svg)](https://phpackages.com/packages/joao-prrvz-php-utils)
```

PHPackages © 2026

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