PHP code example of apollopy / laravel-x-eloquent

1. Go to this page and download the library: Download apollopy/laravel-x-eloquent 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/ */

    

apollopy / laravel-x-eloquent example snippets


ApolloPY\Eloquent\EloquentServiceProvider::class,

$ids = [3, 1, 2];
$posts = Post::find($ids); // collection -> [1, 2, 3]
$posts = $posts->sortByIds($ids); // collection -> [2 => 3, 0 => 1, 1 => 2]
$posts = $posts->values(); // collection -> [3, 1, 2]

Topic::where('user_id', 1)->chunkByTime(3600, function ($topics) {
    //
});