G
G
ganjo8882018-12-11 16:08:11
Laravel
ganjo888, 2018-12-11 16:08:11

How to include the Cache class in Laravel?

<?php

namespace App\Http\Controllers;

use Cache;

class ChannelController extends Controller
{
    public function popular()
    {
        Cache::put('test','test value',10);
    }
}

Writes Undefined class Cache how to connect correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
netrox, 2018-12-11
@ganjo888

use Illuminate\Support\Facades\Cache;
https://laravel.com/docs/5.7/cache#cache-usage

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question