anourvalar / eloquent-serialize
Laravel 查询构建器(Eloquent)序列化
1.2.25
2024-09-16 12:59 UTC
Requires
- php: ^7.4|^8.0
- laravel/framework: ^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.26
- laravel/legacy-factories: ^1.1
- orchestra/testbench: ^6.0|^7.0|^8.0|^9.0
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.5|^10.5
- psalm/plugin-laravel: ^2.8
- squizlabs/php_codesniffer: ^3.7
README
支持:Laravel 6 - Laravel 11
安装
composer require anourvalar/eloquent-serialize
使用
序列化
$package = \EloquentSerialize::serialize( \App\User::query() ->with('userPhones') ->where('id', '>', '10') ->limit(20) );
反序列化
$builder = \EloquentSerialize::unserialize($package); foreach ($builder->get() as $item) { // ... }