PHPackages                             laravie/serialize-queries - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. laravie/serialize-queries

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

laravie/serialize-queries
=========================

Serializable Laravel Query Builder

v3.3.0(3mo ago)707.7M↓54.7%64MITPHPPHP ^8.1CI passing

Since Oct 1Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/laravie/serialize-queries)[ Packagist](https://packagist.org/packages/laravie/serialize-queries)[ RSS](/packages/laravie-serialize-queries/feed)WikiDiscussions 3.x Synced 2d ago

READMEChangelog (10)Dependencies (13)Versions (25)Used By (4)

Serializable Laravel Query Builder
==================================

[](#serializable-laravel-query-builder)

[![tests](https://github.com/laravie/serialize-queries/actions/workflows/tests.yaml/badge.svg?branch=3.x)](https://github.com/laravie/serialize-queries/actions/workflows/tests.yaml)[![Latest Stable Version](https://camo.githubusercontent.com/cb94e122ce4d1ee5d5c4703cad0e998f825b71ee422131c24e89fe1e7e742d19/68747470733a2f2f706f7365722e707567782e6f72672f6c6172617669652f73657269616c697a652d717565726965732f762f737461626c65)](https://packagist.org/packages/laravie/serialize-queries)[![Total Downloads](https://camo.githubusercontent.com/835685316382d88de3fcd774925ddd61359888225dc7a43bddef51e9ebcc828f/68747470733a2f2f706f7365722e707567782e6f72672f6c6172617669652f73657269616c697a652d717565726965732f646f776e6c6f616473)](https://packagist.org/packages/laravie/serialize-queries)[![Latest Unstable Version](https://camo.githubusercontent.com/5e593fdea9e259a25e74952f94668aab8e7319cf42bbe826b85589cf9173acfa/68747470733a2f2f706f7365722e707567782e6f72672f6c6172617669652f73657269616c697a652d717565726965732f762f756e737461626c65)](https://packagist.org/packages/laravie/serialize-queries)[![License](https://camo.githubusercontent.com/036fa2b4440c87a39d558b950201f0a86823ed9ac5ef890f9927ed16a2d241fe/68747470733a2f2f706f7365722e707567782e6f72672f6c6172617669652f73657269616c697a652d717565726965732f6c6963656e7365)](https://packagist.org/packages/laravie/serialize-queries)[![Coverage Status](https://camo.githubusercontent.com/0bae326a17b70bdfdf7fc915cf4cc8e8b26db0b78147e48b1d7c2634b6bcd0c2/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6c6172617669652f73657269616c697a652d717565726965732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/laravie/serialize-queries?branch=master)

Serialize Queries allows developer to serialize Query/Eloquent Builder to be used in Laravel Queues.

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

[](#installation)

To install through composer, run the following command from terminal:

```
composer require "laravie/serialize-queries"
```

Usages
------

[](#usages)

### Eloquent Query Builder

[](#eloquent-query-builder)

#### Serialize

[](#serialize)

```
Laravie\SerializesQuery\Eloquent::serialize(
    \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Relations\Relation $builder
): array;
```

The method provide simple interface to serialize Eloquent Query Builder.

```
use App\Model\User;
use Laravie\SerializesQuery\Eloquent;

$query = User::has('posts')->where('age', '>', 25);

$serializedQuery = Eloquent::serialize($query);
```

#### Unserialize

[](#unserialize)

```
Laravie\SerializesQuery\Eloquent::unserialize(array $payload): \Illuminate\Database\Eloquent\Builder;
```

The method provide simple interface to unserialize Eloquent Query Builder.

```
use Laravie\SerializesQuery\Eloquent;

$query = Eloquent::unserialize($serializedQuery);
```

### Fluent Query Builder

[](#fluent-query-builder)

#### Serialize

[](#serialize-1)

```
Laravie\SerializesQuery\Query::serialize(
    \Illuminate\Database\Query\Builder $builder
): array;
```

The method provide simple interface to serialize Fluent Query Builder.

```
use Illuminate\Support\Facades\DB;
use Laravie\SerializesQuery\Query;

$query = DB::table('users')->where('age', '>', 25);

$serializedQuery = Query::serialize($query);
```

#### Unserialize

[](#unserialize-1)

```
Laravie\SerializesQuery\Query::unserialize(array $payload): \Illuminate\Database\Query\Builder;
```

The method provide simple interface to unserialize Eloquent Builder.

```
use Laravie\SerializesQuery\Query;

$query = Query::unserialize($serializedQuery);
```

###  Health Score

64

—

FairBetter than 99% of packages

Maintenance87

Actively maintained with recent releases

Popularity58

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 98.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 ~98 days

Recently: every ~202 days

Total

22

Last Release

38d ago

Major Versions

v1.0.1 → v2.0.02022-02-08

v1.0.2 → v2.0.12022-02-12

v1.0.3 → v2.1.02022-11-23

1.x-dev → 2.x-dev2024-01-11

2.x-dev → v3.0.02024-03-07

PHP version history (5 changes)v0.1.0PHP &gt;=7.2

v0.2.0PHP &gt;=7.1

v1.0.0PHP ^7.1 || ^8.0

v2.0.0PHP ^7.3 || ^8.0

v3.0.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/172966?v=4)[Mior Muhammad Zaki](/maintainers/crynobone)[@crynobone](https://github.com/crynobone)

---

Top Contributors

[![crynobone](https://avatars.githubusercontent.com/u/172966?v=4)](https://github.com/crynobone "crynobone (221 commits)")[![faisuc](https://avatars.githubusercontent.com/u/7190009?v=4)](https://github.com/faisuc "faisuc (2 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (1 commits)")[![riesjart](https://avatars.githubusercontent.com/u/23455176?v=4)](https://github.com/riesjart "riesjart (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/laravie-serialize-queries/health.svg)

```
[![Health](https://phpackages.com/badges/laravie-serialize-queries/health.svg)](https://phpackages.com/packages/laravie-serialize-queries)
```

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M193](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[spatie/laravel-settings

Store your application settings

1.5k7.3M151](/packages/spatie-laravel-settings)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M164](/packages/spatie-laravel-health)

PHPackages © 2026

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