Showing 10 of 2,145 results.

Laravel 5 Collections: Removing Collection Elements With forget

The forget method removes an item from the collection based on given $key . The forget method returns a reference to the original collection, meaning it modifies the collection instance it was called on.1 public function forget ( 2 $ keys 3 ) ;The...

Announcement: All Of the Laravel Articles Are Free

Last year I took on an ambitious project titled "Laravel Artisan: An In Depth Coverage of Laravel Features". It was meant to be a comprehensive guide to the Laravel framework. At the point where it became obvious the plug had to be pulled on the...

Modifying the Windows Hosts File

This post will explain how to modify the hosts file on a Windows machine (this post will work for Windows Vista and newer). There are a few different reasons you may need to modify the hosts file, and the most common reason I have seen so far is...

Creating the Tag Method | Building a Simple Statamic Request Addon

Now that we have an empty tag addon class to work with, let's quickly recap what we want this addon tag to do: what we want to be able to do is determine if a URL query parameter exists. The first thing that I like to do is decide how the addon...

Laravel Collection Public API: only

only($keys) The only method is the logical opposite of the except method. The only method is used to return all the key/value pairs in the collection where the keys in the collection are in the supplied $keys array. Internally, this method makes a...

Laravel Collection Public API: sortBy

sortBy($callback, $options = SORT_REGULAR, $descending = false) The sortBy method is useful and versatile way to sort collections by some key, or by some value returned by a $callback . The $callback can either be a function that defines two...