Quite often in e-shops you can see many level of categories and subcategories, sometimes even unlimited. This article will show you how...
I confess - during five years of working with Laravel, I've been fascinated by its "magic" and how little code is needed to actually make things work. But recently, as my projects grew in size, that "magic" started to become a problem. One of the typical example is Eloquent Accessors, so in this article I will put an argument against using them, and what to do instead.
There are situations where you need to get array of IDs for some records in collection/table. I will show you two quick ways to do it - one is pretty popular, and another is a function which I found out only today.
Default belongsToMany relationship in Laravel works really well - you can easily attach, detach or sync records. But what if you want to order pivot records by newest or oldest? This article will show you how.
Nowadays, we have a lot of Laravel tutorial about some syntax or package, but I think there's not enough written with real-life mini-projects, close to real demands of the clients. So will try to write more of these, and this is one of them: imagine a project where you need to have two-step registration process, with some optional fields in the second step. Let's build it in Laravel.
Quite often, especially in e-shop projects, you can see a page to login or register before finishing the purchase. But Laravel has these two routes as separate login and register pages. So how to merge them together and avoid conflicts?
Imagine a Laravel project with 100+ routes, separate section for guest, users, administrators etc. Do you really want to keep it all in one file? How can you group them, add prefixes to URLs? Let's see what options we have.
I want to invite you to my new online-course for those who always wanted to start automated testing with PHPUnit, but "never had time". In this short 90-minutes course, I will give you practical examples and show you that it's really easy to get started with testing.
Laravel Validation system has 60+ validation rules available, but what if you want something extra? You can easily create your own validation rule, or use something already available on the internet. Let's take a look.
Laravel Auth features a function to redirect logged-in user to the same page they were visiting before. So, for example, if you...