Support the ongoing development of Laravel.io →
posted 7 years ago
Views
Last updated 2 years ago.
0
Solution

If you need something like laravel native helper url() or asset(), etc.

create file helpers.php in the app directory.

in composer.json you need something like:

"autoload": {
        "files": [
            "app/helpers.php"
        ],
        "psr-4": {
            "App\\": "app/"        
        }
    },

in the file write custom helper function:

if (! function_exists('super_helper')) {
    /**
     * My custom super helper
     *
     * @param  array  $array
     * @return array
     */
    function super_helper(array $array)
    {
        return $array;
    }
}

in console run

composer dump-autoload
Last updated 7 years ago.
0

Cool, helped me as well =) Thanks

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.