laravel - ReflectionException in Container.php, Class not found?
Posted 一个学者
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了laravel - ReflectionException in Container.php, Class not found?相关的知识,希望对你有一定的参考价值。
ReflectionException in Container.php, Class not found?
PUBLISHED 3 YEARS AGO BY KENNETHJAYSONE
I‘m not sure why i‘m having this issue on Envoyer and not on my local homestead
ReflectionException in Container.php line 736:
Class AppHttpControllersDashboardController does not exist
My DasboardController is namespaced:
<?php namespace AppHttpControllers;
use View;
use Mail;
use Sentinel;
use Redirect;
use Validator;
use Activation;
use Reminder;
use URL;
use Config;
use Session;
/**
* Interfaces to access
*/
use AcmeCarsCarInterface;
use AcmeMediaMediaInterface;
use AppHttpRequests;
use AppHttpControllersController;
use IlluminateHttpRequest;
/**
* Requests
*/
use AppHttpRequestsPostACarRequest;
/**
* Class DashBoardController
* @package AppHttpControllers
*/
class DashBoardController extends AuthorizedController {
}
My composer.json is like this:
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\": "app/"
},
"psr-0": {
"Acme": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
I‘ve followed the steps to upgrading to laravel 5.1 using this article
http://laravel.com/docs/5.1/upgrade#upgrade-5.1.0
Everything works fine on my machine It‘s so weird im really not sure what to do.
Best Answer(As Selected By kennethjaysone)
@kennethjaysone Check your capitalisation!
Class AppHttpControllersDashboardController does not exist
Your Controller is called DashBoardController
class DashBoardController extends AuthorizedController {
}
Your host system (Windows or Mac) is case insensitive by default, and Homestead inherits this behaviour. Your production server on the other hand is case sensitive.
Whenever you get a ClassNotFound Exception
check the following:
- Spelling
- Namespaces
- Capitalisation
@mstnorris Thank you. It worked.
Please sign in or create an account to participate in this conversation.
404 error on /login
Controller not found
Trouble installing on Windows 10
custom messages in reset password form don′t show
Whoops, looks like something went wrong.
Laravel auth with custom error messages
How to display values in returned from ajax call in tabular format Laravel?
Queued tasks are executing as part of the controller, causing app to freeze
User with many relationships, loop within Job class
Dynamic Drop Down
LEARN
DISCUSS
EXTRAS
以上是关于laravel - ReflectionException in Container.php, Class not found?的主要内容,如果未能解决你的问题,请参考以下文章