BossBey File Manager
PHP:
8.2.30
OS:
Linux
User:
imagivibe
Root
/
home
/
imagivibe
/
public_html
/
app.imagivibe.com
/
app
/
Models
/
Concerns
📤 Upload
📝 New File
📁 New Folder
Close
Editing: HasCacheFirst.php
<?php namespace App\Models\Concerns; use Illuminate\Support\Facades\Cache; trait HasCacheFirst { public static function getCache() { return Cache::remember(self::$cacheKey, self::$cacheTtl, static function () { return self::query()->first(); }); } public static function forgetCache(): void { Cache::forget(self::$cacheKey); } }
Save
Cancel