Wednesday, October 31, 2018

How to Create a Laravel Helper

As we discussed earlier, there are plenty of helpers available in the core of the Laravel framework. They are grouped together based on the functionality they provide. Here’s a list of helper groups.
Helpers in this group provide functionality to manipulate array elements. More often than not, you're in the situation where you want to perform different operations on array elements. So this is the place where you should look first to see if what you're looking for already exists.
I find helpers in this category most useful. They return the fully qualified path of different directories like app, storage, config, and the like. I bet you're using most of these helpers already in your Laravel application.
String manipulation is something inevitable in your day-to-day application development. Although there are plenty of string manipulation functions provided by PHP itself, you'll find a few more useful goodies in this section.
You'll find very few in this category, but they are used throughout the application. They are used to generate route, asset, and form action URLs.
This category contains helpers that provide a variety of functionalities ranging from logging to debugging and many more.

No comments:

Post a Comment