Answers for "how to create helper class in laravel"

PHP
-1

laravel helper function custom

Create a helpers.php file in your app folder and load it up with composer:

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

After adding that to your composer.json file, run the following command:

composer dump-autoload
Posted by: Guest on June-01-2021
-2

laravel helper

use Illuminate\Support\Str;

$length = Str::length('Laravel');

// 7
Posted by: Guest on January-24-2021
-1

add custom helper laravel

"autoload": {
    "classmap": [
        "database/seeds",
        "database/factories"
    ],
    "psr-4": {
        "App\\": "app/"
    }
},
"autoload-dev": {
    "psr-4": {
        "Tests\\": "tests/"
    }
},
Posted by: Guest on December-23-2020

Code answers related to "how to create helper class in laravel"

Browse Popular Code Answers by Language