1

What I have done:

  • fresh composer install of CakePHP 4.3.1
  • bin/cake bake plugin Admin
  • config the db connection successfully
  • bin/cake bake all Articles --plugin Admin
  • put this route $routes->connect('/admin/articles', ['plugin' => 'Admin', 'controller' => 'Articles']); in the config/routes.php
  • opened the plugins/Admin/src/Controller/ArticlesController.php and change the line use App\Controller\AppController; to the use Admin\Controller\AppController;

However, after trying to request the admin/articles route I am getting the 404 error saying Missing controller with description that the Admin.ArticlesController could not be found. Also, the help on the error page suggests to create the controller which is already there, on the exactly same route as suggested. The plugin is loaded in Application.php ($this->addPlugin('Admin');) so everything should be fine, so I am confused. What I am doing wrong?

petiar
  • 1,047
  • 2
  • 14
  • 31
  • Is the admin articles controller in the Admin\Controller namespace? Did you do `composer dumpautoload` after baking the plugin? – Greg Schmidt Nov 19 '21 at 22:37
  • @GregSchmidt Thank you for your interest. Yes and yes, unfortunately, still having the issue. – petiar Nov 20 '21 at 10:19

0 Answers0