📜  laravel 添加实用程序类 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:41.281000             🧑  作者: Mango

代码示例1
# How to register utilities class on Laravel 5.8
# File: composer.json
# ref: https://stackoverflow.com/questions/28290332/best-practices-for-custom-helpers-in-laravel-5
"autoload": {
    "classmap": [
        ...
    ],
    "psr-4": {
        "App\\": "app/"
    },
    "files": [
        "app/helpers.php" // <---- ADD THIS
    ]
},
 
 # Then run: `composer dump-autoload`