When I use cache on laravel, 5 it keeps on giving me an error Class 'App\Http\Controllers\Cache' not found
<?php namespace App\Http\Controllers;
class ChannelController extends Controller {
public function popular()
{
Cache::put('test','test value',10);
}
}
It's just a simple cache but still not working. By the way, my config for cache is set to memcached - and it is working fine on laravel 4.2, but not on laravel 5.
Cache is not inside your App namespace, you can either:
<?php namespace App\Http\Controllers;
use \Cache;
class ChannelController extends Controller {
You can then use Cache
throughout your class. Alternatively you can add a \
to the existing line you have:
\Cache::put('test','test value',10);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With