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']);
CodePudding user response:
There are extra 's' in Route. Try change to
Route::put('update-order/{id}',[UserController::class , 'updateOrder']);
Route::get('orders',[OrderController::class, 'index']);