The Blog

Laravel

Calculating Averages Using Collections in Laravel

John Koster
John Koster
March 23, 2016

Learn how to use the avg method in Laravel collections to calculate the average value of items. You can use the optional $key parameter to specify which property of the collection to average. If no key is provided, the method assumes the collection contains numeric values and averages all items. The avg method also works on collections of objects using the same syntax. Additionally, you can use "dot" notation to average nested properties in arrays or objects.

PHP

Xdebug and var_dump

John Koster
John Koster
July 13, 2015

If you are using Xdebug with PHP and are using the var_dump function it is important to note that Xdebug will limit var_dump 's depth when dumping information ...

Sublime Text Snippets For LeanPub

John Koster
John Koster
July 12, 2015

← KeePass. Failed to Load the Specified File!

Microsoft/Windows

Microsoft .NET Framework Download Locations

John Koster
John Koster
July 5, 2015

← PHP Slow Response Times

PHP

PHP Slow Response Times

John Koster
John Koster
February 1, 2015

Microsoft .NET Framework Download Locations

Laravel

Semantic UI Paginator for Laravel 4

John Koster
John Koster
December 13, 2014

Learn how to create a custom paginator for Semantic UI in Laravel 4 with this step-by-step tutorial. The tutorial provides the necessary HTML markup and code snippets, along with explanations, to guide you through the process. By the end, you'll have a Paginator that generates Semantic UI compatible markup.

jQuery: Checking if an Item is an Array

John Koster
John Koster
October 25, 2014

Semantic UI Paginator for Laravel 4

Thoughts on a "Guidance Engine"

John Koster
John Koster
October 18, 2014

We could create a new website targeted at a specific range of topics. I will not point any one out in particular, but the process is fairly straightforward and ...

Laravel

Laravel and Kint Debugging

John Koster
John Koster
September 20, 2014

Learn how to enhance your Laravel development workflow by integrating Kint, a powerful debugging tool. Follow the steps provided in this tutorial to require Kint in your project and modify one of its functions to work seamlessly with Laravel. Discover how to use the new lk() function as a replacement for Laravel's dd() function to display detailed Kint table breakdowns. Improve your debugging experience with this simple yet effective solution.

Latest posts

That Escalated Quickly: All the New Things

The past six months or so have been incredibly busy. What started as a new article series about cust...

Read more
Troubleshooting a Statamic Illegal Offset Type Error when Viewing Collection Entries in the Control Panel

In this post I talk about how I resolved a mysterious illegal offset type error when viewing collect...

Read more
Creating Simple HTTP Redirect Routes from a Statamic Site

Generating a custom Laravel routes file from a Statamic website to redirect to a new domain.

Read more
Disabling Vite File Hashes

Disabling file hashes in Vite output can be accomplished by modifying your project's vite.config.js

Read more
Implementing a Custom Laravel Blade Precompiler for Volt and Livewire

Learn how to implement a custom component compiler for Laravel's Blade templating language in this p...

Read more
Creating a Hybrid Cache System for Statamic: Part Five

Part 5 of 6 covers implementing a cache namespace and labeling system, which we can use to target mu...

Read more