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 App\Http\Controllers\DashboardController does not exist

My DasboardController is namespaced:


<?php namespace App\Http\Controllers; use View;
use Mail;
use Sentinel;
use Redirect;
use Validator;
use Activation;
use Reminder;
use URL;
use Config;
use Session; /**
* Interfaces to access
*/ use Acme\Cars\CarInterface;
use Acme\Media\MediaInterface; use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request; /**
* Requests
*/ use App\Http\Requests\PostACarRequest; /**
* Class DashBoardController
* @package App\Http\Controllers
*/ 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 App\Http\Controllers\DashboardController 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:

  1. Spelling
  2. Namespaces
  3. Capitalisation

mstnorris

3 years ago(499,525 XP)

@kennethjaysone Check your capitalisation!

Class App\Http\Controllers\DashboardController 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:

  1. Spelling
  2. Namespaces
  3. Capitalisation

@mstnorris Thank you. It worked.

Martha

1 year ago(6,330 XP)

it worked with me after I run "composer update"

Worked with me after running composer dump-autoload.

Please sign in or create an account to participate in this conversation.

CREATE ACCOUNT

CHOOSE A FILTER

OR PICK A CHANNEL

404 error on /login

I deployed a brand-new Laravel project to my EC2 server and it shows up fine, but when I set up Auth it 404's when trying to view /login. Apache's...
20

Controller not found

Hello, I have a problem: my controller AvatarController is not found. His namespace is App\Http\Controllers\User....
20

Trouble installing on Windows 10

I need a "holiday dev computer", so I'm installing Laravel on a Windows 10 laptop. In the past, I have always installed on Linux and it w...
18

custom messages in reset password form don´t show

To change the reset password custom messages I add to the ResetPasswordController 2 methods (rules() and validationErrorMessages()). However, the c...
17

Whoops, looks like something went wrong.

Hi! Sorry total noob here I was wondering what I could do to solve this error: It runs fine locally, so my steps are upload the...
15

Laravel auth with custom error messages

I'm using the Laravel Auth but I would like to have custom error messages: $rules = [ 'email' => 'required|email|exists:users...
12

How to display values in returned from ajax call in tabular format Laravel?

Guys I have a data in table which I displayed in view.blade in tabular format This is the code <thead> <th> <a hre...
12

Queued tasks are executing as part of the controller, causing app to freeze

OK I'm new to job queues in Laravel but I've read all the documentation and I thought I understood them. My app needs to queue hundreds of j...
11

User with many relationships, loop within Job class

Hey all, I have a bunch of users that will all have or may not have have a tenancy (rental on a property) and is a belongsTo re...
11

Dynamic Drop Down

I have a data base as follow: companies -> id, name contact-> id,name,company_id now I need a drop down list to choose the comp...
09
 
 

Lots of your peers think Laracasts is one of the best things ever. So buy Jeffrey lunch once a month, see for yourself, and massively level up your skills in the process.

© Laracasts 2018. All rights reserved. Yes, all of them. That means you, Todd.
Proudly hosted with Laravel Forge and DigitalOcean.

laravel - ReflectionException in Container.php, Class not found?的更多相关文章

  1. Laravel之Service Container服务容器

    managing class dependencies and performing dependency injection. Dependency injection is a fancy phr ...

  2. 深入讲解 Laravel 的 IoC 服务容器

    众所周知,Laravel 控制反转 (IoC) / 依赖注入 (DI) 的功能非常强大.遗憾的是, 官方文档 并没有详细讲解它的所有功能,所以我决定自己实践一下,并整理成文.下面的代码是基于 Lara ...

  3. Laravel 学习笔记之 Composer 自动加载

    说明:本文主要以Laravel的容器类Container为例做简单说明Composer的自动加载机制. Composer的自动加载机制 1.初始化一个composer项目 在一个空目录下compose ...

  4. Laravel核心之IOC和Facade 架构分析1

    控制反转(Inversion of Control) 缩写为IoC 最常见的方式叫做依赖注入 简单说来,就是一个类把自己的的控制权交给另外一个对象,类间的依赖由这个对象去解决. Laravel 中的使 ...

  5. laravel学习:模块化caffeinated

    # Modules Extract and modularize your code for maintainability. Essentially creates "mini-larav ...

  6. Laravel修炼:服务容器绑定与解析

    前言   老实说,第一次老大让我看laravel框架手册的那天早上,我是很绝望的,因为真的没接触过,对我这种渣渣来说,laravel的入门门槛确实有点高了,但还是得硬着头皮看下去(虽然到现在我还有很多 ...

  7. How To Use The Repository Pattern In Laravel

    The Repository Pattern in Laravel is a very useful pattern with a couple of great uses. The first us ...

  8. 【PHP】用了这么久的Laravel框架,你分析过核心架构了没

    Laravel最初的设计是为了面向MVC架构的,它可以满足如事件处理.用户身份验证等各种需求.另外它还有一个由管理数据库强力支持,用于管理模块化和可扩展性代码的软件包管理器. Laravel以其简洁. ...

  9. 记一次laravel-jwt修改黑名单所用redis数据库

    场景是这样的,我用tymon/jwt包做鉴权.jwt是自编码token,过期前想要强制失效只能将其加入黑名单中,黑名单一般用缓存存储. 但会有一个问题,若某种意外情况不小心执行了php aritsan ...

随机推荐

  1. python3绘图示例6-1(基于matplotlib,绘图流程介绍及设置等)

    #!/usr/bin/env python# -*- coding:utf-8 -*- import os import pylab as pyimport numpy as npfrom matpl ...

  2. 搭建Web开发环境JavaEE_Eclipse

    1. 下载和安装1.1 下载JDK在Java官方网站下载最新版本的 Java SE:  http://www.oracle.com/technetwork/java/javase/downloads/ ...

  3. 1.5配置NetBackup数据库备份策略(nbu策略catalog)

    1.5配置NetBackup数据库备份策略 建议定期备份NetBackup的索引数据库Catalog,以确保故障时的有效恢复.从Javaconsole可以进入备份NetBackup内部数据库配置窗口, ...

  4. HTTP Method 详细解读(`GET` `HEAD` `POST` `OPTIONS` `PUT` `DELETE` `TRACE` `CONNECT`)--转

    前言 HTTP Method的历史: HTTP 0.9 这个版本只有GET方法 HTTP 1.0 这个版本有GET HEAD POST这三个方法 HTTP 1.1 这个版本是当前版本,包含GET HE ...

  5. MyBatis的优缺点以及特点

    特点: mybatis是一种持久层框架,也属于ORM映射.前身是ibatis. 相比于hibernatehibernate为全自动化,配置文件书写之后不需要书写sql语句,但是欠缺灵活,很多时候需要优 ...

  6. 第27章 LTDC/DMA2D—液晶显示—零死角玩转STM32-F429系列

    第27章     LTDC/DMA2D—液晶显示 全套200集视频教程和1000页PDF教程请到秉火论坛下载:www.firebbs.cn 野火视频教程优酷观看网址:http://i.youku.co ...

  7. 激活SQLPrompt7.4及以上版本

    SQLPrompt是个很好的sql server提示工具,SQL-SERVER2016只能使用SQLPrompt7.x 以上版本,用激活工具激活后没多久就会检测到激活码不可用.所以感觉是不是有个服务在 ...

  8. BZOJ1202: [HNOI2005]狡猾的商人(带权并查集)

    Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 4577  Solved: 2249[Submit][Status][Discuss] Descript ...

  9. Java分享笔记:泛型类的定义与使用

    当类中要操作的引用数据类型不确定时,可以定义泛型类完成扩展.下面是程序演示. package packB; class Student { //定义学生类 public String st = &qu ...

  10. mybatis的坑——不报错,就是不能committing,数据存不进数据库

    测试的时候会报空指针异常,在项目跑的时候会停止执行程序,不会出现异常. 经过一星期的排查与测试,最终找到错误,把mapper文件的映射属性名写错了. property属性名要与接收类的属性名保持一致. ...