Search code examples
phproutescakephp-3.0

Cakephp 3 Missing Route issue


I am working on CakePHP 3 web application in which routes are not working for root '/'. I have gone through several questions related to this issue but the issue is not resolved.

enter image description here

Below is the configuration of config/routes.php file

use Cake\Core\Plugin;
use Cake\Routing\RouteBuilder;
use Cake\Routing\Router;
use Cake\Routing\Route\DashedRoute;
use Cake\ORM\TableRegistry;

Router::defaultRouteClass(DashedRoute::class);


Router::scope("/", function (RouteBuilder $routes) {        
    $routes->connect('/', ['controller' => 'users', 'action' => 'login']);
    $routes->fallbacks(DashedRoute::class);
});

Plugin::routes();

It looks like the root '/' route defined in routes.php is not loading, I have checked the path of routes.php which is included in "/vendor/cakephp/cakephp/src/Routing/Router.php" is correct. What may be incorrect here?

enter image description here


Solution

  • I found the solution, deleting "myapp_cake_model_route" cache file in tmp/cache resolved this issue and now routes are loading