Laravel has a great feature of binding models by id field. So you can specify edit(User $user) and system would know to find the user from ID in the URL. But what if you want to bind by some other field?
In modern multi-tenancy systems, it's pretty popular to give a specific sub-domain for every user or company, like laraveldaily.slack.com. How to handle these subdomains in Laravel routes?
Sometimes you need to create a controller which doesn't cover all seven resourceful methods, like index(), create(), store() etc. You just need controller which does one thing and you're struggling how to name that method. No more struggle, there's __invoke() method.
Laravel Validation mechanism has a lot of various rules. Let's pick the ones that can be applied to graphical files.
Quick tip for those who want to list some events, grouping them by some date value - by day, month, year etc.
A common problem while working in a team is some custom variables needed, when only one person on the team knows that they are needed, and then other people have errors because they don't have that variable. Like API Tokens for 3rd party apps, default values for some function - basically, anything that should be in .env file. So here's an instruction for you, how to put new environment variables correctly, without screwing up teammates work.
I got this question at least a dozen times: "I'm raising my file validation rule in Laravel to 20 MB but still get errors, it doesn't work". So decided to expand on it and explain the reason, and what to do.
One of the most often things to change in web-projects is adapting it to a certain geographical area - language and timezones are two examples. But also there's a date format, which can be pretty different in certain parts of the world. How to handle it properly in Laravel?
For some reason, only now I've found out about a feature that was introduced in Laravel 5.5 - artisan command that makes your validation rule, similar to Request classes. Let's see it in action.
Quick tip of the day. Default Laravel Auth comes with User table and model, but without logging capability, so we need to build it ourselves. Fortunately, it's very easy, I will show you one method.