1. Go to this page and download the library: Download eilander/repository 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/ */
namespace App\Http\Controllers;
use Eilander\Repository\Listeners\EloquentClearCache;
use App\Http\Controllers\Controller;
use App\Http\Requests\FruitRequest;
use App\Repositories\FruitRepository;
class FruitController extends Controller {
/**
* @var FruitRepository
*/
protected $repository;
public function __construct(FruitRepository $repository){
$this->repository = $repository;
}
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
// cache for 15 minutes
$fruits = $this->repository->minutes(15)->paginate(50);
or
// cache for 6 hours
$fruits = $this->repository->hours(6)->paginate(50);
or
// cache for 4 days
$fruits = $this->repository->days(4)->paginate(50);
return view('fruits.index', compact('fruits'));
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.