2

I always have this message:

Illuminate\Contracts\Container\BindingResolutionException Target class [MessagesController] does not exist. 

On some route and URL requests,

MessagesController however is not contained on my route web files, and in any of my controllers.

Can someone explain to me why the Controller class gives a warning?

Target class [MessagesController] does not exist.

Follow-up question, is there a way I can remove an unused controller by an artisan command?

5
  • 2
    Does this answer your question? Target class does not exist. problem in laravel 8 Commented Feb 15, 2021 at 6:23
  • Does this answer your question? Target class controller does not exist - Laravel 8 Commented Jun 7, 2021 at 5:28
  • Yes, sorry Kamlesh and Paul, this is already been solved. My bad I didn't use the class MessageController inside routes on web.php. Commented May 30, 2022 at 11:24
  • 1
    Did you solve this problem? Commented Jul 25, 2022 at 13:43
  • Yes I think, but I can't barely recall, but in this page I believe it's been resolved by importing the MessageController when accessing the controller. Commented Feb 18, 2023 at 12:13

1 Answer 1

0

The solution I made for this is to import MessagesController class, I'm so dumb I didn't figured it out.

On route:

use App\Https\Controller\MessagesController; 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.