Source: vumanhtrung.medium.com

Create Custom Helper Class in Laravel 7
In this article, let’s learn how to create a custom helper class in Laravel 7. Next, create a app\Utilities\SiteHelper.php file.

In config\app.php, add key and value in array of Aliases. And then in your composer.json file add the following “files” array to the autoload section. It should look something like this: Run follow command in Terminal: How to use: In controller code
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners