In this video, you can learn how to create and use custom helper function in Laravel.
What is a Helper Function?
A helper function usually comes in handy if you want to add a feature to your Laravel application that can be used at multiple locations within your controllers, views, or model files.
These functions can be considered as global functions.
Steps:
Create Helpers folder inside app/http folder
Create Helper.php file inside Helpers folder
Go to composer.json and add in autoload object
Run this command on terminal "Composer dump-autoload"
Use helper function any where you like helperFunction();
#laravel #helperFunction#laravelHelperFunction