AnourValar / eloquent-serialize by AnourValar

Laravel Query Builder (Eloquent) serialization
5,111,140
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: 2024-12-17 03:10:12
Package Statistics
Total Downloads: 5,111,140
Monthly Downloads: 573,634
Daily Downloads: 23,338
Total Stars: 94
Total Watchers: 3
Total Forks: 8
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) {
    // ...
}