Category : redis

I am working on real time notifications, I am using the following packages: "predis/predis": "^1.1" "laravel-echo": "^1.4.0", "io": "^1.0.0", "socket.io": "^2.1.1", "socket.io-client": "^2.4.0" I also downgraded the socke.io-client version and also added dot "." before event name. But I don’t get any response on my frontend. Can anybody help me out My laravel-echo-server configurations are ..

Read more

How can I change cache value without changing cache ttl? Is there a way to do that with Laravel Cache facade or should I just make some workaround, like this one: $ttl = 100; Cache::put(‘key’, [ ‘value’ => ‘foo’, ‘created_at’ => now(), ], $ttl); $data = Cache::get(‘key’); $data[‘value’] = ‘bar’; $newTtl = $ttl – $data[‘created_at’]->diffInSeconds(now()); ..

Read more

I am currently working on a laravel 8 project that have been upgraded from Laravel 6.x. I have installed telescope and it works fine. Now i would like to start using redis for my queues instead of using database continuously, so I installed the php this phpredis package vetruvet/laravel-phpredis then modified the PhpRedisServiceProvider register method ..

Read more

I am experiencing a weird error laravel route [login] not defined. There are multiple answers on this site, but nothing seems to help. My configuration is very simple: Route::group([‘middleware’ => ‘myAuth’], function() { Route::get (‘login’, ‘[email protected]’); }); myAuth middleware can be as simple as return next($request), the resulting error is still the same. However, no ..

Read more

I have a schedule task which runs every 5 minutes. This schedule command puts some data to Redis cache via controller. Kernel.php … protected $commands = [ CommandsDataCommand::class, ]; protected function schedule(Schedule $schedule) { $schedule->command(‘data:cache’)->everyFiveMinutes()->onOneServer()->runInBackground(); } DataCommand.php … public function handle() { app(‘AppHttpControllersDataProcessing’)->setCache(); } DataProcessing.php … public function setCache() { $data = [‘one’, ‘two’, ‘three’]; ..

Read more

I have one event with two listeners. I need to stop listener propagation when the first listener fails. For example: Event: RegisterUserEvent Listeners: StoreUserListener and SendVerificationEmailListener If, for any reason, the user can’t be stored in database, I want that SendVerificationEmailListener doesn’t execute. I’m I using Lumen 8.x and the events are processed with Redis. ..

Read more

I just started using redis to cache data and run queries. I have two functions, one for fetching the data, and another one for filtering the cached data. This is how my function for fetching data looks : if (Auth::user()->access_level == ‘Admin’ || Auth::user()->access_level == ‘Donor’) { $clients_number = Cache::remember(‘all_clients_number’, 21600, function () { return ..

Read more

I have an array containing the member name and the distance returned on using geosearch with distance. 0 => array ( 0 => ‘2819483906’, 1 => ‘19.8286’, ), 1 => array ( 0 => ‘2819912246’, 1 => ‘19.6780’, ) I also have some data associated with the member name containing some key value pairs stored ..

Read more

https://github.com/AltThree/Locker After instaling this package in laravel a file called locker.php is being created under the config directory. <?php declare(strict_types=1); /* * This file is part of Alt Three Locker. * * (c) Alt Three Services Limited * * For the full copyright and license information, please view the LICENSE * file that was distributed ..

Read more

I’m trying to publish to a key that will be subscribed to on a node server and in the redis-cli MONITOR absolutely nothing is showing when I request a controller with $redis->publish(‘test-chan’, ‘hello world’); and I’m also using tinker like so: kylehurst messenger-app % vendor/bin/sail tinker >>> use IlluminateSupportFacadesRedis; >>> $redis = Redis::connection(); => IlluminateRedisConnectionsPhpRedisConnection ..

Read more