Polymorphic Relations

We’ve made it to the scariest of Eloquent relations: polymorphic. Don’t worry! As with most things, the word is scarier than the technique. A polymorphic relationship allows a model to belong to any number of models on a single association. Let’s demonstrate this with a practical example.
Source: Laracasts

Has Many Through

While not nearly as common, the hasManyThrough relationship, when necessary, can prove to be incredibly useful. This relationship type allows you to perform queries across long-distance relationships.
Source: Laracasts

Many to Many

Many to many relationships are a bit more confusing to understand. Let’s break it down by reviewing the common "posts" and "tags" relationship. A one-to-one or one-to-many relationship isn’t quite right here. A post will never own a tag. It can be associated with one, sure, but it doesn’t own the tag. The same is true in reverse. When we encounter situations such as this, a "many-to-many" relationship is exactly what we need.
Source: Laracasts

Laravel Self-Diagnosis Package

Laravel Self-Diagnosis is a package by Marcel Pociot that performs self-diagnostics tests on your application. The checks include standard things like setting the ‘APP_KEY’ environment variable when checking out a new project. Learn how you can use this package to diagnose common configuration settings needed to start working on a Laravel application.

Visit Laravel News for the full post.

The post Laravel Self-Diagnosis Package appeared first on Laravel News.

Source: Laravel News

Better Sizing and Spacing With rems

While pixels have long been the go-to unit for declaring font-sizes, the truth is that, these days, it’s not the best choice. What if, instead, we could declare our sizes and spacing dynamically, based upon the font-size of the root HTML element? Think about the possibilities. Your layout could scale seamlessly, from mobile to widescreen devices.
Source: Laracasts

1 2 3 4 26