Questions tagged [laravel-cache]

29 questions
8
votes
7 answers

Is there some sort of Laravel Controller cache?

Weird problem I'm having with Laravel 5.5 I can update and even delete a controller and yet it appears as if a cached / old version is still being called. I've tried clearing cache, clearing route cache, clearing config cache - doesn't seem to have…
jeremyj11
  • 589
  • 1
  • 5
  • 15
4
votes
1 answer

How to pass a PSR-6 compliant cache adapter in Laravel 6.X?

I note there is a cache.psr6 container alias but if I use: new Cache As the instance, I get an error that getItems isn't available, which, I assume, means I am not passing a PSR-6 compliant cache instance. I'm using Redis if that changes the config…
Colin
  • 675
  • 1
  • 11
  • 32
4
votes
1 answer

Laravel - will the use of too many reusable components in blade views slower the page access or put a load on server?

I'm structuring a webapp in manner to maximize the use of resusable components, by making use of components and slot feature provided by the blade. My only concern is will the use of too many reusable component slow the page access or put a load on…
Tintin
  • 475
  • 1
  • 5
  • 16
2
votes
1 answer

Laravel Can't disable Maintenance mode

I've put my Laravel into the maintenance mode with php artisan down. No I try to disable the mode with the command from the docs (php artisan up) but nothing happends. I've cleared all Laravel caches and my browser cache. What is wrong?
Markus
  • 1,909
  • 4
  • 26
  • 54
2
votes
1 answer

Laravel Eloquent Caching pagination aggregate count result

is somehow possible to cache count result for pagination query? select count(*) as aggregate from table_name I have table with 2 000 000+ and it tooks ~300ms every time to calculate this count. Cache this result for 1 hour would be sufficient…
PayteR
  • 1,727
  • 1
  • 19
  • 35
1
vote
0 answers

Remove all items from cache whose key start with string

I want to remove all the cache items whose key is starting with custom string. Currently, I have a PermissionObserver for the Permission model with a custom trait ObserverEvent to called this handle method. class PermissionObserver { use…
JS TECH
  • 1,556
  • 2
  • 11
  • 27
1
vote
2 answers

Why $time from $lock=Cache::lock('name', $time) should be greater than the updating Cache time?

I placed this code inside a Route::get() method only to test it quicker. So this is how it looks: use Illuminate\Support\Facades\Cache; Route::get('/cache', function(){ $lock = Cache::lock('test', 4); if($lock->get()){ Cache::put('name',…
PMekuli
  • 90
  • 8
1
vote
0 answers

Laravel Unable to prepare route [{fallbackPlaceholder}] for serialization. Uses Closure

when i run php artisan route:cache or php artisan optimize it's return : Unable to prepare route [{fallbackPlaceholder}] for serialization. Uses Closure. at vendor/laravel/framework/src/Illuminate/Routing/Route.php:1150 1146| */ 1147| …
1
vote
2 answers

Laravel Cache Forget Remember Forever Cache Not Working?

I am trying to store the last run time of a scheduled job in Laravel. However, the cache is not updating the date. I want the cache to be remembered until the function is called again. public function setLastRun() { …
1
vote
1 answer

How to store one variable in a cache inside one controller method and access it in another method in the same controller? - Laravel 6

In my application, I am trying to save user information in a cache variable and access it in another method. I can access it inside the same method. But when I try to access out of that method, it returns null. I need to know how to achieve this,…
user13080158
1
vote
2 answers

Real world usage example of Laravel Cache Tags

According to Laravel Documentation Cache tags allow you to tag related items in the cache and then flush all cached values that have been assigned a given tag. You may access a tagged cache by passing in an ordered array of tag names. For …
Foued MOUSSI
  • 4,643
  • 3
  • 19
  • 39
1
vote
1 answer

Reset Cache TTL in each Access

I was wondering if there is any way to update cache TTL from the last time it has accessed? currently, I have a method to login to adobe connect with API call and API session is valid for 4 days from the last call. but my cache driver only keeps…
Soheil Rahmat
  • 491
  • 3
  • 15
1
vote
1 answer

How to manage Laravel file cache for multi tenant using same codebase

Laravel:5.6 Php:7.1 I am having multiple tenants(platforms) application with the single codebase and using the file cache. I need to handle the cache removal for specific platform. I tried to set the cache config storage path on runtime to set the…
Abdul Samad
  • 81
  • 1
  • 8
1
vote
3 answers

Not enough arguments (missing: "key"). in laravel php artisan cache:forget

When i try to remove my all cache file from laravel 5.5 project i got some error during run this command php artisan cache:forget Not enough arguments (missing: "key").
Md Hasibur Rahaman
  • 1,041
  • 3
  • 11
  • 34
1
vote
1 answer

laravel Cache Queryies with conditions

i am trying to load a cached value by providing a segment of it's key and i can't find out how...i want something like SQL syntax Example here but with laravel caching system: select * where key like '%{segment of the key }%' PS: i am using file…
Omar Ajmi
  • 180
  • 1
  • 13
1
2