Skip to content

Commit

Permalink
Updates the routes.php file to remove deprecation warnings (#18)
Browse files Browse the repository at this point in the history
* Removes Cake\Routing\Router::plugin() deprecation

Replaced the Router class with RouterBuilder as it became deprecated in CakePHP version 4.3

* Updated CakePHP version
  • Loading branch information
Andream98 authored Jan 20, 2022
1 parent 501ba92 commit 1f0e531
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "cakephp-plugin",
"license": "MIT",
"require": {
"cakephp/cakephp": "^4.1.0",
"cakephp/cakephp": "^4.3.0",
"ishanvyas22/asset-mix": "^1.0"
},
"require-dev": {
Expand Down
20 changes: 10 additions & 10 deletions config/routes.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

use Cake\Routing\Route\DashedRoute;
use Cake\Routing\RouteBuilder;
use Cake\Routing\Router;
use Cake\Routing\Route\DashedRoute;
use Cake\Routing\RouteBuilder;

Router::plugin(
'Inertia',
['path' => '/inertia'],
function (RouteBuilder $routes) {
$routes->fallbacks(DashedRoute::class);
}
);
/** @var RouteBuilder $routes */
$routes->plugin(
'Inertia',
['path' => '/inertia'],
function (RouteBuilder $routes) {
$routes->fallbacks(DashedRoute::class);
}
);

0 comments on commit 1f0e531

Please sign in to comment.