Why it's bad to code PHP on Windows environment
I see quite a lot of PHP developers using Windows operating system. And there's nothing wrong with that. But if you look closer...
In-depth Laravel tutorials covering advanced topics, real-world examples, and best practices.
I see quite a lot of PHP developers using Windows operating system. And there's nothing wrong with that. But if you look closer...
We all use Carbon library to manage date and time, right? But who has actually read full documentation of what functions it has? In addition to well-known ones like now() or format(), Carbon has a lot more useful stuff. Let's take a look.
After having launched a couple dozens of projects with Laravel, I decided to create a checklist for the launches. The problem is quite often something is forgotten or overlooked - either from our team side, or from the client. So this checklist should prevent it and possibly would help you in your launches too.
As a tradition of posting little things here on the blog, one more useful detail. What do you do when you need to show a loop in Blade with foreach, but the list might be empty? You probably write if-else statement around it, right?
Lately I've been re-reading full Laravel documentation and found quite a lot of "small details" which no one actually noticed in tutorials or books. One of these is using "-" symbol in route parameters.
Sometimes there is a need to set a default column value for database field - if it's not provided when creating the entry. There are two simple ways of doing it.
We all know that file app/Http/routes.php is used for listing all possible routes we need for our application. But what if we need to define a rule for "everything else"? Like, we have a list of our routes, and if the URL doesn't match any of those rules - we want to, for example, redirect to homepage instead of showing 404 error.
Laravel logging mechanism is pretty simple - it writes all the errors to a file at /storage/logs/laravel.log. It's convenient until the file gets bigger. And then you have a problem to find a bug from yesterday or some days ago. How can you solve this?
After a while I'm back to my Laravel Business video channel, and topic of this 5-minute episode is security, for Laravel projects and beyond.
Everyone had a situation when one variable had to be accessible in every view file, for some of us it was $user, for others it was $currentPage or any other case dependent variable. And some of you use Base Controller for that. Let me show you why it's wrong.