AnourValar / eloquent-serialize by AnourValar

Laravel Query Builder (Eloquent) serialization
7,354,530
99
3
Package Data
Maintainer Username: AnourValar
Package Create Date: 2020-04-05
Package Last Update: 2025-03-22
Language: PHP
License: MIT
Last Refreshed: 2025-04-01 03:09:37
Package Statistics
Total Downloads: 7,354,530
Monthly Downloads: 743,547
Daily Downloads: 31,499
Total Stars: 99
Total Watchers: 3
Total Forks: 10
Total Open Issues: 0

Serialization for Eloquent's QueryBuilder

Supports Laravel 6+

Installation

composer require anourvalar/eloquent-serialize

Usage

Serialize

$package = \EloquentSerialize::serialize(
    \App\User::query()
        ->with('userPhones')
        ->where('id', '>', '10')
        ->limit(20)
);

Unserialize

$builder = \EloquentSerialize::unserialize($package);

foreach ($builder->get() as $item) {
    // ...
}