How can I autoload a custom class in Laravel 5.1?

前端 未结 4 1061
無奈伤痛
無奈伤痛 2021-02-08 21:32

I\'ve created a library folder within the app folder to add my own classes.

This is the content of the file app/library/helper.p

4条回答
  •  时光取名叫无心
    2021-02-08 21:59

    Use files directive in composer.json: https://getcomposer.org/doc/04-schema.md#files

    {
        "autoload": {
            "files": ["app/library/helper.php"]
        }
    }
    

提交回复
热议问题