Description
Web File:
Controller File:-
Import File:-
adssd
View Code
Hello Sir, I'm using excel library to import bulk data, but i don't know why i m getting 404 error even i have cross check all the routes and methods. please guide me where i m wrong. My file name start with Airquality.
0 Likes 2 Comments
Vanita saini Author
Sir, now the issue is resolved, but I don't know how it was resolved. I just changed the route sequence. please guide me what rule we should follow when define any routes. Route::prefix('auth')->middleware(['auth','isAdmin'])->group(function(){ //Route::view('/','auth.dashboard'); Route::get('/dashboard', [DashboardController::class, 'dashboard'])->name('dashboard'); Route::resource('/posts', PostController::class); Route::resource('/categories', CategoryController::class); Route::resource('/stations', StationController::class); Route::get('/airqualities/import',[AirqualityController::class, 'import'])->name('airqualities.import'); Route::post('/airqualities/import',[AirqualityController::class, 'importSave'])->name('airqualities.importSave'); Route::resource('/airqualities', AirqualityController::class); Route::get('/categories/download/{filename}',[CategoryController::class, 'download'])->name('categories.download'); Route::get('/categories/remove/{id}',[CategoryController::class, 'remove'])->name('categories.remove'); Route::resource('/modules', ModuleController::class); Route::get('/modules/download/{filename}/{filetype?}',[ModuleController::class, 'download'])->name('modules.download'); Route::post('/posts/get-additional-fields', [PostController::class, 'getAdditionalFields'])->name('posts.get-additional-fields'); }); i just placed get, post urls above the resource urls.
Hadayat Niazi Super Admin
Hadayat Niazi Super Admin
Hadayat Niazi Super Admin
Where you are using AirqualitiesImport, you are just showing your routes and controller method which are opening views, please share the code where you are getting error. Also please post the description and code in the correct section, you are posting your code inside description and writing description inside code, please write it correctly. Thanks for the understanding.
your main issue was your resource route is overriding your one of the method that's you are facing this issue.