Tutorials

10 less-known (but awesome!) Laravel Collections methods

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.

Building a Laravel form without Illuminate/html

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.

How to create a Laravel 5 package in 10 easy steps

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.

Pivot tables and many-to-many relationships

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.

Eloquent hasManyThrough: jumping deeper into relationships

Quite often in bigger projects there are DB relationships with more than one level: categories->companies->products, countries->teams->players and similar. If we need to get the list of a deeper level, there's a quick way of doing that with Eloquent.

Query Scopes – convenient way to isolate often-used conditions

One of less-known but useful Eloquent functions are scopes - basically, you can define conditions to be re-used in various other places in code. Here's an overview.

Laravel 5.1.11 introduces ACL system

Another great news for Laravel community - more and more often repeated functions become a part of Laravel framework itself. Today a new addition is Authorization or ACL functionality.

How to use external classes and PHP files in Laravel Controller?

Laravel is an MVC framework with its own folder structure, but sometimes we want to use something external which doesn't follow the same structure. Let's review two different scenarios - when we have external class and when it's just a .php file.

CSRF protection difference: Laravel 4.x, 5.0 and 5.1

For those who work with different Laravel versions on different projects, it's useful to know the difference of CSRF logic - it changed a little from 4.x to 5.x.

CRUD: How to avoid building whole Form for Delete button

There is one annoying thing in Laravel RESTful approach - if you want to have Edit/Delete links in your tables, Edit is done easy with a link to URL, but for Delete you have to build the whole form. Is there a way to avoid it?

STAY CONNECTED

1,782FansLike
5,512FollowersFollow
6,393SubscribersSubscribe

NEWEST VIDEOS

RANDOM ARTICLES