From 1f0e531a2c639b5c60088d4f8266337141d66cfd Mon Sep 17 00:00:00 2001 From: Andrea Martella <52160332+Andream98@users.noreply.github.com> Date: Thu, 20 Jan 2022 09:25:07 +0100 Subject: [PATCH] Updates the routes.php file to remove deprecation warnings (#18) * Removes Cake\Routing\Router::plugin() deprecation Replaced the Router class with RouterBuilder as it became deprecated in CakePHP version 4.3 * Updated CakePHP version --- composer.json | 2 +- config/routes.php | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index f4ab89c..1fd9dd5 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/config/routes.php b/config/routes.php index d0f2353..fa11d56 100644 --- a/config/routes.php +++ b/config/routes.php @@ -1,13 +1,13 @@ '/inertia'], - function (RouteBuilder $routes) { - $routes->fallbacks(DashedRoute::class); - } -); + /** @var RouteBuilder $routes */ + $routes->plugin( + 'Inertia', + ['path' => '/inertia'], + function (RouteBuilder $routes) { + $routes->fallbacks(DashedRoute::class); + } + );