How can I autoload a custom class in Laravel 5.1?

前端 未结 4 1449
栀梦
栀梦 2021-02-08 21:34

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:41

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

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

提交回复
热议问题