0

I want to send some cache to the database. But when I run the cache function there isn't a row in the database Cache::forever('key', 'data');

If I had a dd to it, it returns null.

Things I did

  • Making a migration file

    Schema::create('cache', function (Blueprint $table) { $table->string('key')->unique(); $table->mediumText('value'); $table->integer('expiration');

    • Including the use Cache; Class
    • Changed 'default' => env('CACHE_DRIVER', 'database'), in config/cache.php
    • Also in .env file CACHE_DRIVER=database

Did I miss something :) (Thank you)

9
  • 1
    Is your error log outputting anything? Commented Nov 26, 2018 at 13:38
  • Thank you for your reply, but no it only returns NULL Commented Nov 26, 2018 at 13:42
  • 1
    I am sure you did this, but I will ask anyway, did you run migration? Commented Nov 26, 2018 at 13:42
  • Yes, I did. The table exists Commented Nov 26, 2018 at 13:43
  • 1
    Let us continue this discussion in chat. Commented Nov 26, 2018 at 13:54

1 Answer 1

0

It seems that deleting my config.php file in bootstrap/cache/ seems to work. I re-run the command

Laravel 5 - Cache remember doesn't work

Thanks you all

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.