Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Class "Routes" not found laravel 9

Before Everything is working fine,When I added a route Routes::get('orders',[OrderController::class, 'index']); and then I optimize the laravel using php artisan optimize this through an error and I have no idea why it’s coming, I double check each and everything but this error is far different from the normal error of importing class and correct routes

its imported web.php

use Illuminate\Support\Facades\Route;

   


   Error 

  Class "Routes" not found

  at C:\xampp\htdocs\Scripting_Language_project\routes\web.php:87
     83▕     Route::put('update-product/{id}',[ProductController::class , 'update']);
     84▕     Route::get('delete-product/{id}',[ProductController::class , 'delete']);
     85▕     Route::put('update-order/{id}',[UserController::class , 'updateOrder']);
     86▕
  ➜  87▕     Routes::get('orders',[OrderController::class, 'index']);

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

There are extra ‘s’ in Route. Try change to

Route::put('update-order/{id}',[UserController::class , 'updateOrder']);
Route::get('orders',[OrderController::class, 'index']);
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading