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 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)
mstnorris

@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
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
kennethjaysone

@mstnorris Thank you. It worked.

Martha
Martha
1 year ago (6,330 XP)

it worked with me after I run "composer update"

kiiyaerick

Worked with me after running composer dump-autoload.

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

CREATE ACCOUNT
dagfooyo
404 error on /login
LARAVEL •  1 DAY AGO BY  CRONIX
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
PotTime
Controller not found
LARAVEL •  2 DAYS AGO BY  SNAPEY
Hello, I have a problem: my controller AvatarController is not found. His namespace is App\Http\Controllers\User. ...
20
vincej
Trouble installing on Windows 10
LARAVEL •  1 DAY AGO BY  NEWBIE360
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
johnk
custom messages in reset password form don´t show
LARAVEL •  8 HOURS AGO BY  TOBY
To change the reset password custom messages I add to the ResetPasswordController 2 methods (rules() and validationErrorMessages()). However, the c ...
17
InfinityLoop
Whoops, looks like something went wrong.
LARAVEL •  2 DAYS AGO BY  CRONIX
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
johnk
Laravel auth with custom error messages
LARAVEL •  1 DAY AGO BY  SNAPEY
I'm using the Laravel Auth but I would like to have custom error messages: $rules = [ 'email' => 'required|email|exists:users ...
12
AbdulBazith
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
dagfooyo
Queued tasks are executing as part of the controller, causing app to freeze
LARAVEL •  1 DAY AGO BY  DAGFOOYO
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
theUnforgiven
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
trihead
Dynamic Drop Down
LARAVEL •  1 DAY AGO BY  TRIHEAD
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
 
 

Laracasts

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

转载于:https://www.cnblogs.com/leigepython/p/9295774.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值