Laravel 创建全局函数文件function.php

#关于全局函数 ("app/Helpers/Functions.php")
#找到composer.json文件中的autoload修改成:
"autoload": {
    "psr-4": {
        "App\\": "app/",
        "Database\\Factories\\": "database/factories/",
        "Database\\Seeders\\": "database/seeders/"
    },
    "files": [
        "app/Helpers/Functions.php"
    ]
},

#打开命令行执行
composer dump-autoload

  

posted @ 2022-05-07 16:14  感情就是后人乘凉  阅读(136)  评论(0编辑  收藏  举报