Laravel Eloquent is awesome – probably I don’t need to tell you that. What is less known is the list of methods to work with Eloquent Collections. You can filter them, slice them, easily modify etc. But let’s look at it one by one.
Laravel 5 version got us confused by separating our beloved Form::open world into a separate package. Now you have to add “illuminate/html”: “~5.0” to your projects, whenever you want to use forms, right? Not necessary, you can survive without it.
Last night Taylor announced a pleasant surprise for the beginners of Laravel – new Quickstart section in the official documentation.
Another quick tip and thing to watch out for. When processing form data, how do you check if the field is not empty? With $request->has(‘field’), right? But what about uploaded files?
Title of the article might sound unclear, but let’s imagine you have customer list from Customer::all(), but then you need two separate lists/tables – customers from UK and from US. How to avoid two queries here? There’s a filter() function.
While working on migration files in Laravel, it’s relatively easy to forget one small detail which will restrict you from creating foreign keys. Let me tell you more.
Recently I’ve found out a nice little way to speed up generating of database stuff – I used to use make:migration and make:model Artisan commands separately. Apparently, they can be combined into one.
So you want to create your own package? Surprisingly, this topic has little information online and not properly described in the official docs. Let’s fill in the gaps and create a new Laravel 5 package from scratch.