Use Traits in Laravel in Policies
I love using Policies in Laravel. A particularly useful feature is the interception of checks. But what if only some of our policies need that? That’s where we can judiciously use traits.
I love using Policies in Laravel. A particularly useful feature is the interception of checks. But what if only some of our policies need that? That’s where we can judiciously use traits.
What’s the difference between unit test, integration test, and a feature test? Which should you use for what type of test? Is it just preference or does performance factor in when using Laravel? Let me give you my take from over a decade of unit testing experience.
There seems to be an endless debate: clearly written code doesn’t need comments vs comments are needed to explain code and give context. I can see both sides of this debate, but there is a middle ground. Let me show you one way.
Please indulge me on a bit of an open-ended question and discussion. Recently I saw some “state of the XYZ” surveys where those were specific languages. The surveys were only answered by about 3,000 people each. And then people spoke about them as authoritative references. But are these surveys actually accurate?
The question is this: When creating a helper method in PHP, should you use a named function in the global scope, or an anonymous function assigned to a variable?
One of the most painful things for programmers - whether you’re in a startup or an established business - is leaving code alone that you know could be better. That should be better. There are reasons for this - but what about when it comes to deleting code?
I had a nightmare that someone had access to my Github account and was deleting every repo I had before my eyes. I couldn’t figure out how to stop them and invalidate the proper token. I woke up and decided that I am not ok with this one point-of-failure of my historical work. So I wrote a script to back it up.
I’d like to say I don’t ever have tons of error logs in my Laravel projects - but, sometimes it happens. With a sea of text, how can you see what you need to see easily? Enter JetBrain’s idealog plugin in PHPStorm.
The State of Security of Laravel Apps in 2021 is a whitepaper based on the quiz submissions from Laravel programmers.
What if you need to see your config quickly in Laravel from the command line? And you don’t want to use Tinker? Let me show you how I do it…