Ted
Ted

Reputation: 4166

Laravel 5: Save extra cached data

Is there a way to Store extra informations related to cached data?

Laravel 5 default:

Cache::add('key', 'value', $minutes);

I need to store user_id too, to determine this cache related to which user,

and will add user_id to cache table design,

thx

Upvotes: 2

Views: 86

Answers (1)

Hammerbot
Hammerbot

Reputation: 16324

You should make it with the key attribute:

Cache::add('key_from_user_' . $user_id, 'value', $minutes);

Upvotes: 1

Related Questions