anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

1.2.25 2024-09-16 12:59 UTC

README

Supports: Laravel 6 - Laravel 11

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