PHP code example of anourvalar / eloquent-serialize

1. Go to this page and download the library: Download anourvalar/eloquent-serialize library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

anourvalar / eloquent-serialize example snippets


$package = \EloquentSerialize::serialize(
    \App\User::query()
        ->with('userPhones')
        ->where('id', '>', '10')
        ->limit(20)
);

$builder = \EloquentSerialize::unserialize($package);

foreach ($builder->get() as $item) {
    // ...
}