[英]ReflectionException Laravel 5.1
I have developed an application with Laravel, version 5.1, using homestead to test. 我已经使用Homestead进行测试并使用Laravel 5.1版开发了一个应用程序。
When I place it on the production server, I get this error that I can't replicate on the local machine: 当我将其放置在生产服务器上时,出现了无法在本地计算机上复制的错误:
ReflectionException in Container.php line 736
Class MyMultiSelect does not exist
This class is a sleeping-owl Custom Form Item http://sleeping-owl.github.io/en/Form_Elements/Custom_Form_Elements.html 此类是一个猫头鹰的自定义表单项http://sleeping-owl.github.io/zh_CN/Form_Elements/Custom_Form_Elements.html
I checked for: 我检查了:
I even placed the class in the global namespace 我什至将类放在全局名称空间中
tried to load the file containing the class in composer.json
尝试在composer.json
加载包含类的文件
Filename : MyMultiSelect.php
文件名 : MyMultiSelect.php
Class : MyMultiSelect
类别 : MyMultiSelect
namespace: Global so to access it \\MyMultiSelect
命名空间:全局,因此可以访问它\\MyMultiSelect
admin/bootstrap.php
FormItem::register('myMultiSelect', \\MyMultiSelect::class);
Can anyone help me? 谁能帮我?
Run composer dump-autoload on your server. 在服务器上运行composer dump-autoload 。 This will rebuild the autoloader cache, that stores paths to classes. 这将重建自动加载器缓存,该缓存存储类的路径。 If your paths are different locally and on the server, this could help. 如果您的路径在本地和服务器上不同,则可能会有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.