Requests: has() and hasFile()
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?
In-depth Laravel tutorials covering advanced topics, real-world examples, and best practices.
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?
Great quick news for the Laravel community - today Eric L. Barnes, author of Laravel News website, announced Laravel News Podcast! So, from now we can have new information about Laravel in audio format.
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.
If your application gets bigger, it makes sense to structure Controllers with sub-folders. But it takes a little more effort than just moving the files here and there. Let me explain the structure.
If you install a fresh Laravel and create your app, you may notice that all created_at and other timestamp fields in database are being saved in UTC timezone. How to change it? Easy.
Quick tip for today - let's imagine we have a one-to-many relationship between Categories and Products, and we often show list of products here and there in our app. What if we want them ordered by name alphabetically? Should we add orderBy in every query? No, we can define that in relationship itself.
Today I want to talk about a feature of Laravel which is really useful but can be potentially difficult to understand at first. Pivot table is an example of intermediate table with relationships between two other "main" tables.