AnourValar / eloquent-serialize by AnourValar

Laravel Query Builder (Eloquent) serialization
5,577,243
94
3
Package Data
Maintainer Username: AnourValar
Package Create Date: 2020-04-05
Package Last Update: 2024-11-30
Language: PHP
License: MIT
Last Refreshed: 2025-01-16 03:09:54
Package Statistics
Total Downloads: 5,577,243
Monthly Downloads: 443,059
Daily Downloads: 24,730
Total Stars: 94
Total Watchers: 3
Total Forks: 9
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) {
    // ...
}