Why is the class not found error occurring?

2026-06-10 21:464阅读0评论SEO教程
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计1133个文字,预计阅读时间需要5分钟。

Why is the class not found error occurring?

注册登录目录系列播客讨论注册登录目录系列播客讨论异常:容器.php中未找到类?发表3年前作者:Kenneth Jayson One I‘d

SIGNUPSIGNINSIGNUPSIGNINCATALOGSERIESPODCASTDISCUSSIONSCATALOGSERIESPODCASTDISCUSSIONSRefl SIGN UPSIGN IN
  • CATALOG
  • SERIES
  • PODCAST
  • DISCUSSIONS

ReflectionException in Container.php, Class not found?

PUBLISHED 3 YEARS AGO BY KENNETHJAYSONE

Why is the class not found error occurring?

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:

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

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
3 years ago

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

  • Spelling
  • Namespaces
  • 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:

  • Spelling
  • Namespaces
  • Capitalisation
  • kennethjaysone
    3 years ago(15,020 XP)

    @mstnorris Thank you. It worked.

    Martha
    1 year ago(6,330 XP)

    it worked with me after I run "composer update"

    kiiyaerick
    10 months ago(10,610 XP)

    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

    • All Threads
    • Popular This Week
    • Popular All Time
    • Solved
    • Unsolved
    • No Replies Yet
    • Leaderboard

    OR PICK A CHANNEL

    •  All
    • Code Review
    • Eloquent
    • Envoyer
    • Forge
    • General
    • Guides
    • Javascript
    • Laravel
    • Lumen
    • Mix
    • Requests
    • Servers
    • Site Feedback
    • Spark
    • Testing
    • Tips
    • Vue

    404 error on /login

    LARAVEL ? 1 DAY AGO BY CRONIXI 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

    LARAVEL ? 2 DAYS AGO BY SNAPEYHello, I have a problem: my controller AvatarController is not found. His namespace is App\Http\Controllers\User....20

    Trouble installing on Windows 10

    LARAVEL ? 1 DAY AGO BY NEWBIE360I 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

    LARAVEL ? 8 HOURS AGO BY TOBYTo 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.

    LARAVEL ? 2 DAYS AGO BY CRONIXHi! 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

    LARAVEL ? 1 DAY AGO BY SNAPEYI‘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?

    LARAVEL ? 2 DAYS AGO BY ABDULBAZITHGuys I have a data in table which I displayed in view.blade in tabular format This is the code ...12

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

    LARAVEL ? 1 DAY AGO BY DAGFOOYOOK 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

    LARAVEL ? 5 DAYS AGO BY THEUNFORGIVENHey 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

    LARAVEL ? 1 DAY AGO BY TRIHEADI 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.

    LEARN
    • Library
    • Lesson Index
    • Books
    • Sign Up
    • Sign In
    DISCUSS
    • Forum
    • Laracasts Snippet
    • Laravel Podcast
    • Support
    EXTRAS
    • Statistics
    • Testimonials
    • FAQ
    • Youtube
    • Get a Job
    • RSS
    • Privacy
    • Terms
    ? 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?

    标签:Classnotfound

    本文共计1133个文字,预计阅读时间需要5分钟。

    Why is the class not found error occurring?

    注册登录目录系列播客讨论注册登录目录系列播客讨论异常:容器.php中未找到类?发表3年前作者:Kenneth Jayson One I‘d

    SIGNUPSIGNINSIGNUPSIGNINCATALOGSERIESPODCASTDISCUSSIONSCATALOGSERIESPODCASTDISCUSSIONSRefl SIGN UPSIGN IN
    • CATALOG
    • SERIES
    • PODCAST
    • DISCUSSIONS

    ReflectionException in Container.php, Class not found?

    PUBLISHED 3 YEARS AGO BY KENNETHJAYSONE

    Why is the class not found error occurring?

    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:

    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

    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
    3 years ago

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

  • Spelling
  • Namespaces
  • 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:

  • Spelling
  • Namespaces
  • Capitalisation
  • kennethjaysone
    3 years ago(15,020 XP)

    @mstnorris Thank you. It worked.

    Martha
    1 year ago(6,330 XP)

    it worked with me after I run "composer update"

    kiiyaerick
    10 months ago(10,610 XP)

    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

    • All Threads
    • Popular This Week
    • Popular All Time
    • Solved
    • Unsolved
    • No Replies Yet
    • Leaderboard

    OR PICK A CHANNEL

    •  All
    • Code Review
    • Eloquent
    • Envoyer
    • Forge
    • General
    • Guides
    • Javascript
    • Laravel
    • Lumen
    • Mix
    • Requests
    • Servers
    • Site Feedback
    • Spark
    • Testing
    • Tips
    • Vue

    404 error on /login

    LARAVEL ? 1 DAY AGO BY CRONIXI 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

    LARAVEL ? 2 DAYS AGO BY SNAPEYHello, I have a problem: my controller AvatarController is not found. His namespace is App\Http\Controllers\User....20

    Trouble installing on Windows 10

    LARAVEL ? 1 DAY AGO BY NEWBIE360I 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

    LARAVEL ? 8 HOURS AGO BY TOBYTo 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.

    LARAVEL ? 2 DAYS AGO BY CRONIXHi! 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

    LARAVEL ? 1 DAY AGO BY SNAPEYI‘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?

    LARAVEL ? 2 DAYS AGO BY ABDULBAZITHGuys I have a data in table which I displayed in view.blade in tabular format This is the code ...12

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

    LARAVEL ? 1 DAY AGO BY DAGFOOYOOK 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

    LARAVEL ? 5 DAYS AGO BY THEUNFORGIVENHey 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

    LARAVEL ? 1 DAY AGO BY TRIHEADI 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.

    LEARN
    • Library
    • Lesson Index
    • Books
    • Sign Up
    • Sign In
    DISCUSS
    • Forum
    • Laracasts Snippet
    • Laravel Podcast
    • Support
    EXTRAS
    • Statistics
    • Testimonials
    • FAQ
    • Youtube
    • Get a Job
    • RSS
    • Privacy
    • Terms
    ? 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?

    标签:Classnotfound