douwen8424 2016-06-13 09:24
浏览 73
已采纳

在Laravel中将类库包含到控制器中但未找到类

I'm trying to include class library to controller but when I run the page I've got

production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'MyClass' not found'...

I have added this class to app/libraries and in composer.json added this

"app/libraries",

Also I have tried to add it in global.php

app_path().'/libraries',

and still got this message. Any ideas and solutions on this?

  • 写回答

1条回答 默认 最新

  • dongmi1872 2016-06-13 10:04
    关注

    Do a composer dumpautoload to rebuild the autoloading files for your new class.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?