Looking to hire Laravel developers? Try LaraJobs

eloquent-serialize maintained by anourvalar

Description
Laravel Query Builder (Eloquent) serialization
Last update
2025/12/04 14:38 (dev-master)
License
Downloads
18 260 857

Comments
comments powered by Disqus

Serialization for Eloquent's QueryBuilder

Supports: Laravel 6 - Laravel 12

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) {
    // ...
}