PHP code example of martianatwork / laravel-query-cache

1. Go to this page and download the library: Download martianatwork/laravel-query-cache 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/ */

    

martianatwork / laravel-query-cache example snippets


$users = User::where("id", ">", "1")
    ->with(['posts' => function ($q) { $q->remember(10); }])
    ->remember(10)
    ->take(5)
    ->get();