There is no problem not worth solving, and no technology not worth learning!

In Laravel 9, when executing redis::set($this->rules_update_key, carbon::now()); Differences in Predis/Predis packages

在 Laravel 9 中,在执行 Redis::set($this->rules_update_key, Carbon::now()); 后,发现写入的值是 Object

1. In Laravel 9, after executing redis::set($this->rules_update_key, carbon::now()); and found that the written value is Object. as shown in Figure 1

在 Laravel 9 中,在执行 Redis::set($this->rules_update_key, Carbon::now()); 后,发现写入的值是 Object
Figure 1

2. But in the test environment, the written value is a datetime string. Its value: 2024-01-30 06:00:00. as shown in Figure 2

但是在测试环境中,写入的值却是一个日期时间字符串。其值:2024-01-30 06:00:00
Figure 2

3. The final comparison found that the root of the difference is that in the .env file, there is one more line of configuration in the test environment


REDIS_CLIENT=predis


PHP / Laravel / Yii2 Legacy Project Maintenance & Long-Term Technical Support

If your PHP / Laravel / Yii2 project is already in production but needs bug fixing, API troubleshooting, performance optimization, developer handover support, or long-term maintenance, feel free to contact me for remote technical support.

Ideal For:
✅ PHP legacy systems without active maintenance
✅ Laravel / Yii2 project bug fixes
✅ Admin panel feature iterations
✅ RESTful API troubleshooting
✅ MySQL / Redis / Nginx performance issues
✅ Long-term remote part-time maintenance

We can start with a small task:
✅ Production error troubleshooting
✅ API issue analysis
✅ Slow query and performance bottleneck diagnosis
✅ Initial code structure review
✅ Deployment environment and log inspection

If you would like to discuss your project, please contact me and mention: PHP Maintenance Consultation.

Contact Me:
Telegram: @shuijingwan
WeChat: 13980074657
Email: shuijingwanwq@gmail.com

评论

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.