As I was using Cursor/VSCode, one thing I really missed from PHPStorm was a Laravel Idea feature that lets you create Laravel files from the context menu.
So I made one for VSCode.
marketplace.visualstudio.com/items?itemName=Junveloper.vscode-laravel-file-creator
Sharing this hoping that it would help someone!
Jun Im
@kyungjunim
I write things that I learnt here and there. Happy to be corrected!
• • 3 Posts • 216 Views
One of the resource files was causing a n+1 problem. But, due to our business logic, we made a decision not to eager load the relationship. My solution was to save the owner_id of each businesses in a cache.
I wrote tests and they passed without a problem. Existing functionalities worked as expected locally. But, when it was pushed to the production, it caused an issue where the returning value was always false, even when it should have been true.
The issue was that I was using a different cache driver. This was an issue because Redis stores everything as a string value and would not return an integer (which I did not know about).
Lessons learnt:
1. Mirror your production env as closely as possible.
2. Redis stores everything in string.
@nunomaduro How does mutation testing work? (it's magical by the way!! thank you). Does it pretty much temporarily remove any line/parts of code that cause mutation? and hence if your test coverage is good, make your tests fail and catch them?