I was trying to cache the db query with built in function remember(). But it doesn't seem to be working fine. Here is fine snippets.
$categories = Category::orderBy('rank', 'asc')
->select('id', 'name', 'rank')
->where('parentid', '=', 0)
->where('id', '<>', 4)
->remember(300)
->get();
This is the reference link, which I was following. I am getting the following error messa
Call to undefined method Illuminate\Database\Query\Builder::remember()
Category.php
<?php
namespace App;
use Eloquent;
use Illuminate\Database\Eloquent\Model;
class Category extends Model
{
//
}
from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2NdaJcr
via IFTTT
Aucun commentaire:
Enregistrer un commentaire