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?

vvvvv
  • 25,404
  • 19
  • 49
  • 81
Two
  • 512
  • 4
  • 17
  • 2
    Does this answer your question? [Target class does not exist. problem in laravel 8](https://stackoverflow.com/questions/63882034/target-class-does-not-exist-problem-in-laravel-8) – Kamlesh Paul Feb 15 '21 at 06:23
  • Does this answer your question? [Target class controller does not exist - Laravel 8](https://stackoverflow.com/questions/63807930/target-class-controller-does-not-exist-laravel-8) – I. Antonov Jun 07 '21 at 05: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. – Two May 30 '22 at 11:24
  • 1
    Did you solve this problem? – ExpertWeblancer Jul 25 '22 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. – Two Feb 18 '23 at 12:13

1 Answers1

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;
Two
  • 512
  • 4
  • 17