Named function or anonymous function for PHP helper
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?
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…
First off, if you can use something like mailtrap I definitely recommend doing it. Mailtrap provides credentials and configuration so you can capture all of your email into a test inbox. But if that’s not possible, there is another option - and it has to do with Laravel’s mail events.
If you follow the instructions to customize the configuration of Bugsnag’s Laravel package, they’ll tell you to run vendor:publish
. But this is not what I want.
I use Laravel Nova in a lot of my projects, but I’ve never liked the idea of storing the files in a local directory after download. Yes, you can use credentials for a Composer-based install, true, but I wanted something that didn’t require that. Turns out you can install packages like Laravel Nova from a zip file locally. Here’s how.
I’ll say it again: do not install Laravel Tinker in production, and certainly do not use it. It’s a great tool to do work in your application, but only in test and development environments. That’s why I only install it in my require-dev
section of my composer.json
file.