mercredi 26 août 2015

How can I use Cache during application bootstrapping?

I am migrating a Laravel 4.2 application to Laravel 5.1.

During bootstrap, when loading the mail configuration file (config/mail.php), I want to read my SMTP configuration from DB and cache it. In order to do that I use an Eloquent model class, in which I use the Cache facade's remember() function to get the data I need.

It used to work in 4.2, but after switching to 5.1, I get the following error message:

Call to a member function remember() on a non-object

This happens after I put the following line at the top of the class:

use Illuminate\Support\Facades\Cache;

Without that line I got a Class 'Cache' not found error message.

Any idea what am I missing? Is this even possible in 5.1?

Thanks a lot!



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1MMR1uA
via IFTTT

Aucun commentaire:

Enregistrer un commentaire