I am trying to filter the cache data using the below code
$Categories = \Cache::rememberForever('Categories', function() {
return \App\Models\Skill\Category_Model::all();
});
$Category = $Categories::where("CategoryID", "=", $id)->first();
Error details :
Non-static method Illuminate\Support\Collection::where() should not be called statically, assuming $this from incompatible context
Am I missing anything ?
I meant, what's the fastest way to filter the data in cache object. Cache object is a Model. Categories Array contains collection of Models that contains categoryID ID. and I want to filter data based on CategoryID
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire