cache api article for an hour

This commit is contained in:
2021-06-28 11:29:37 +05:00
parent a27d957f3c
commit 4fd5b133df
2 changed files with 2 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ class ArticlesController extends Controller
*/
public function show($source, $guid)
{
$article = Cache::remember("article_" . $source . "_" . $guid, 3600, function () use ($source, $guid) {
$article = Cache::remember("article_" . $source . "_" . $guid, 3600, function () use ($source, $guid) { // Cache for an hour
return Article::whereHas('source', function ($q) use ($source) {
$q->where('slug', $source);