Skip to content
This repository was archived by the owner on Jan 23, 2018. It is now read-only.

Helper Functions

Sam Rapaport edited this page Jul 11, 2016 · 5 revisions

Laravel includes a variety of "helper" PHP functions that allow you to perform basic common tasks. Occasionally, you may wish to create your own helper functions to use in your application. After installing Laravel Kickstart, you'll notice a new file in app/Support called helpers.php. You can define your helper functions there.

In order for these functions to be loaded into your application, head over to the project's composer.json file and add the following lines inside the autoload object:

"files": [
    "app/Support/helpers.php"
]

You can now call the functions defined in this helpers file anywhere in your project! Note: you may need to run composer dump-autoload to regenerate the autoload file.

Clone this wiki locally