Reputation: 1453
I'm using this route in a project hosted in my local mac pc, it is working, but when i have uploaded that to an Ubunto
server route conflict occurred.
Route::group(['prefix'=>'report', 'middleware' => ['auth','session', 'complete_profile']], function() {
Route::get('/get_query', 'ReportController@get_queries');
});
Route::group(['middleware' => ['auth','session', 'complete_profile']], function(){
Route::resource('report','ReportController');
});
for example when i use form first route report/get_query
in online ubunto
server it goes to the show($id)
method of that controller, But in local its working.
What should I do with this ?
Upvotes: 2
Views: 1872
Reputation: 26
Route::group(['prefix'=>'report', 'middleware' => ['auth','session', 'complete_profile']], function() {
Route::resource('/','ReportController',['except' => ['show']]);
Route::get('/get_query', 'ReportController@get_queries');
});
Resource route has predefined route for http methodes. For example reporte resource has route:
Route::get('report/{report}','ReportController@show');
Solution is to exclude some methodes (routes from restfull resource), or to make some routes that wont conflict with route resource.
You can see what route you have registered by running:
php artisan route:list
Also one route group for report is enough just put '/' in resource route.
Upvotes: 1