Hi,
Could you show what you get with php artisan route:list for these 2 routes ?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am relatively new to Laravel. But I am a long way into a project for my job. On April 1st I updated laravel from 5.2.16 to 5.2.28. Everything seemed to be fine and I continued to work on my development.
Yesterday I went to make changes to the landing page ('/') and found that it was trying to go to 'welcome' even though I have not used that, nor had routes to that for months.It was at this point I realized that when I make changes to my routes.php file, that it is not "seeing" those changes. I have tried the route:clear, route:cache, config:clear, view:clear. No changes.
My routes file (a small snip)
// Home Route
Route::get('/home', 'HomeController@index');
// Landing Page (Website) Route
Route::get('/', function () {
return view('landing.index');
});
I have tried changing these to other things, but it does not route differently. (ie, I pointed /home to ReportsController instead). All of the pages I had in place still route fine except the landing.index. As stated, it attempts to go to welcome.blade.php. (Which does not exist.)
So, 1. Is it bad practice to update the Laravel framework in the middle of a project?
If I did not supply enough information, please let me know. I did not want to post more than needed.
Thank you in advance!
Hi,
Could you show what you get with php artisan route:list for these 2 routes ?
You have "auth" middleware twice on second route.
Interesting. It is that way on my entire routes file. Even the guest is web, guest, guest.
Any idea what would cause this?
Maybe some nested route groups or duplicate middleware in controllers.
Odd thing is that I did not change my route file. I only updated Laravel.
Here is my routes.php
<?php
//tmp To be removed later
Route::get('test2', function () {
return view('test2');
});
Route::group(['middleware' => ['web']], function () {
// Home Route
Route::get('/home', 'HomeController@index');
// Landing Page (Website) Route
Route::get('/', function () {
return view('landing.index');
});
//Route::auth();
// Authentication Routes...
Route::get('login', 'Auth\AuthController@showLoginForm');
Route::post('login', 'Auth\AuthController@login');
Route::get('logout', 'Auth\AuthController@logout');
// Password Reset Routes...
Route::get('password/reset/{token?}', 'Auth\PasswordController@showResetForm');
Route::post('password/email', 'Auth\PasswordController@sendResetLinkEmail');
Route::post('password/reset', 'Auth\PasswordController@reset');
Route::get('test', 'TestController@index'); //tmp To be removed later
Route::resource('timesheets', 'TimesheetsController');
// Profile Routing
Route::get('profiles/imageupload', 'ProfileController@imageupload');
Route::post('profiles/imageupload', 'ProfileController@imageprocess');
Route::get('profiles/{id}/removeuserimage', 'ProfileController@removeuserimage');
Route::post('profiles/{id}/updatePassword', 'ProfileController@updatePassword');
Route::resource('profiles', 'ProfileController');
// Report Routing
Route::get('reports', 'ReportsController@index');
Route::get('reports/timesheets', 'ReportsController@timesheets'); // Main Timesheet Report
Route::post('reports/timesheets', 'ReportsController@select'); // Timesheet Report From Date Selector
Route::get('reports/timesheetsPdf/{weekStart}', 'ReportsController@timesheetsPdf'); // Main Timesheet Report
// Contact Routing
Route::resource('contacts', 'ContactsController');
// Employee Routing
Route::resource('employees', 'EmployeesController');
// Job Routing
Route::resource('jobs', 'JobsController');
// Daily Reports Routing
Route::get('dailyreports/{job}/create', 'DailyReportsController@create');
Route::resource('dailyreports', 'DailyReportsController');
// Messaging Routes
Route::group(['prefix' => 'messages'], function () {
Route::get('/', ['as' => 'messages', 'uses' => 'MessagesController@index']);
Route::get('create', ['as' => 'messages.create', 'uses' => 'MessagesController@create']);
Route::post('/', ['as' => 'messages.store', 'uses' => 'MessagesController@store']);
Route::get('{id}', ['as' => 'messages.show', 'uses' => 'MessagesController@show']);
Route::put('{id}', ['as' => 'messages.update', 'uses' => 'MessagesController@update']);
Route::delete('{id}', ['as' => 'message.softdelete', 'uses' => 'MessagesController@softdelete']);
});
});
Anything stand out to you?
Here is my complete route:list
+--------+-----------+-----------------------------------+----------------------+-----------------------------------------------------------------+-----------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+-----------+-----------------------------------+----------------------+-----------------------------------------------------------------+-----------------+
| | GET|HEAD | / | | Closure | web |
| | GET|HEAD | contacts | contacts.index | App\Http\Controllers\ContactsController@index | web,auth,auth |
| | POST | contacts | contacts.store | App\Http\Controllers\ContactsController@store | web,auth,auth |
| | GET|HEAD | contacts/create | contacts.create | App\Http\Controllers\ContactsController@create | web,auth,auth |
| | PUT|PATCH | contacts/{contacts} | contacts.update | App\Http\Controllers\ContactsController@update | web,auth,auth |
| | DELETE | contacts/{contacts} | contacts.destroy | App\Http\Controllers\ContactsController@destroy | web,auth,auth |
| | GET|HEAD | contacts/{contacts} | contacts.show | App\Http\Controllers\ContactsController@show | web,auth,auth |
| | GET|HEAD | contacts/{contacts}/edit | contacts.edit | App\Http\Controllers\ContactsController@edit | web,auth,auth |
| | POST | dailyreports | dailyreports.store | App\Http\Controllers\DailyReportsController@store | web,auth,auth |
| | GET|HEAD | dailyreports | dailyreports.index | App\Http\Controllers\DailyReportsController@index | web,auth,auth |
| | GET|HEAD | dailyreports/create | dailyreports.create | App\Http\Controllers\DailyReportsController@create | web,auth,auth |
| | GET|HEAD | dailyreports/{dailyreports} | dailyreports.show | App\Http\Controllers\DailyReportsController@show | web,auth,auth |
| | DELETE | dailyreports/{dailyreports} | dailyreports.destroy | App\Http\Controllers\DailyReportsController@destroy | web,auth,auth |
| | PUT|PATCH | dailyreports/{dailyreports} | dailyreports.update | App\Http\Controllers\DailyReportsController@update | web,auth,auth |
| | GET|HEAD | dailyreports/{dailyreports}/edit | dailyreports.edit | App\Http\Controllers\DailyReportsController@edit | web,auth,auth |
| | GET|HEAD | dailyreports/{job}/create | | App\Http\Controllers\DailyReportsController@create | web,auth,auth |
| | GET|HEAD | employees | employees.index | App\Http\Controllers\EmployeesController@index | web,auth,auth |
| | POST | employees | employees.store | App\Http\Controllers\EmployeesController@store | web,auth,auth |
| | GET|HEAD | employees/create | employees.create | App\Http\Controllers\EmployeesController@create | web,auth,auth |
| | PUT|PATCH | employees/{employees} | employees.update | App\Http\Controllers\EmployeesController@update | web,auth,auth |
| | GET|HEAD | employees/{employees} | employees.show | App\Http\Controllers\EmployeesController@show | web,auth,auth |
| | DELETE | employees/{employees} | employees.destroy | App\Http\Controllers\EmployeesController@destroy | web,auth,auth |
| | GET|HEAD | employees/{employees}/edit | employees.edit | App\Http\Controllers\EmployeesController@edit | web,auth,auth |
| | GET|HEAD | home | | App\Http\Controllers\HomeController@index | web,auth,auth |
| | GET|HEAD | jobs | jobs.index | App\Http\Controllers\JobsController@index | web,auth,auth |
| | POST | jobs | jobs.store | App\Http\Controllers\JobsController@store | web,auth,auth |
| | GET|HEAD | jobs/create | jobs.create | App\Http\Controllers\JobsController@create | web,auth,auth |
| | GET|HEAD | jobs/{jobs} | jobs.show | App\Http\Controllers\JobsController@show | web,auth,auth |
| | PUT|PATCH | jobs/{jobs} | jobs.update | App\Http\Controllers\JobsController@update | web,auth,auth |
| | DELETE | jobs/{jobs} | jobs.destroy | App\Http\Controllers\JobsController@destroy | web,auth,auth |
| | GET|HEAD | jobs/{jobs}/edit | jobs.edit | App\Http\Controllers\JobsController@edit | web,auth,auth |
| | POST | login | | App\Http\Controllers\Auth\AuthController@login | web,guest,guest |
| | GET|HEAD | login | | App\Http\Controllers\Auth\AuthController@showLoginForm | web,guest,guest |
| | GET|HEAD | logout | | App\Http\Controllers\Auth\AuthController@logout | web |
| | GET|HEAD | messages | messages | App\Http\Controllers\MessagesController@index | web,auth,auth |
| | POST | messages | messages.store | App\Http\Controllers\MessagesController@store | web,auth,auth |
| | GET|HEAD | messages/create | messages.create | App\Http\Controllers\MessagesController@create | web,auth,auth |
| | GET|HEAD | messages/{id} | messages.show | App\Http\Controllers\MessagesController@show | web,auth,auth |
| | DELETE | messages/{id} | message.softdelete | App\Http\Controllers\MessagesController@softdelete | web,auth,auth |
| | PUT | messages/{id} | messages.update | App\Http\Controllers\MessagesController@update | web,auth,auth |
| | POST | password/email | | App\Http\Controllers\Auth\PasswordController@sendResetLinkEmail | web,guest,guest |
| | POST | password/reset | | App\Http\Controllers\Auth\PasswordController@reset | web,guest,guest |
| | GET|HEAD | password/reset/{token?} | | App\Http\Controllers\Auth\PasswordController@showResetForm | web,guest,guest |
| | POST | profiles | profiles.store | App\Http\Controllers\ProfileController@store | web,auth,auth |
| | GET|HEAD | profiles | profiles.index | App\Http\Controllers\ProfileController@index | web,auth,auth |
| | GET|HEAD | profiles/create | profiles.create | App\Http\Controllers\ProfileController@create | web,auth,auth |
| | POST | profiles/imageupload | | App\Http\Controllers\ProfileController@imageprocess | web,auth,auth |
| | GET|HEAD | profiles/imageupload | | App\Http\Controllers\ProfileController@imageupload | web,auth,auth |
| | GET|HEAD | profiles/{id}/removeuserimage | | App\Http\Controllers\ProfileController@removeuserimage | web,auth,auth |
| | POST | profiles/{id}/updatePassword | | App\Http\Controllers\ProfileController@updatePassword | web,auth,auth |
| | PUT|PATCH | profiles/{profiles} | profiles.update | App\Http\Controllers\ProfileController@update | web,auth,auth |
| | GET|HEAD | profiles/{profiles} | profiles.show | App\Http\Controllers\ProfileController@show | web,auth,auth |
| | DELETE | profiles/{profiles} | profiles.destroy | App\Http\Controllers\ProfileController@destroy | web,auth,auth |
| | GET|HEAD | profiles/{profiles}/edit | profiles.edit | App\Http\Controllers\ProfileController@edit | web,auth,auth |
| | GET|HEAD | register | | App\Http\Controllers\Auth\AuthController@showRegistrationForm | web,guest,guest |
| | POST | register | | App\Http\Controllers\Auth\AuthController@register | web,guest,guest |
| | GET|HEAD | reports | | App\Http\Controllers\ReportsController@index | web,auth,auth |
| | GET|HEAD | reports/timesheets | | App\Http\Controllers\ReportsController@timesheets | web,auth,auth |
| | POST | reports/timesheets | | App\Http\Controllers\ReportsController@select | web,auth,auth |
| | GET|HEAD | reports/timesheetsPdf/{weekStart} | | App\Http\Controllers\ReportsController@timesheetsPdf | web,auth,auth |
| | GET|HEAD | test | | App\Http\Controllers\TestController@index | web |
| | GET|HEAD | test2 | | Closure | |
| | GET|HEAD | timesheets | timesheets.index | App\Http\Controllers\TimesheetsController@index | web,auth,auth |
| | POST | timesheets | timesheets.store | App\Http\Controllers\TimesheetsController@store | web,auth,auth |
| | GET|HEAD | timesheets/create | timesheets.create | App\Http\Controllers\TimesheetsController@create | web,auth,auth |
| | DELETE | timesheets/{timesheets} | timesheets.destroy | App\Http\Controllers\TimesheetsController@destroy | web,auth,auth |
| | PUT|PATCH | timesheets/{timesheets} | timesheets.update | App\Http\Controllers\TimesheetsController@update | web,auth,auth |
| | GET|HEAD | timesheets/{timesheets} | timesheets.show | App\Http\Controllers\TimesheetsController@show | web,auth,auth |
| | GET|HEAD | timesheets/{timesheets}/edit | timesheets.edit | App\Http\Controllers\TimesheetsController@edit | web,auth,auth |
+--------+-----------+-----------------------------------+----------------------+-----------------------------------------------------------------+-----------------+
Thank you for your help on this. It is really baffling me!
It is not routes.php related. I went into a backup folder and route:list does not show double auth. I copied that routes.php to my current project and the problem remains.
I found this thread: https://laracasts.com/discuss/channels/laravel/there-is-nothing-wrong-in-the-new-version?page=1
By updating to 5.2.29 it has corrected the double auth situation in the route:list. It did not however repair my routing issue. :(
So I noticed too, that if I make a change in the routes.php such as:
// Home Route
Route::get('/home', 'HomeController@index');
changed to:
// Home Route
Route::get('/dashboard', 'HomeController@index');
It reflects it in route:list but does not actually route. So if I go to www.mydomain.tld/dashboard, I get a 404.
Does anyone else have any ideas? I am really at a loss here. No matter what I do, I can not stop it from going to welcome.blade.php. I tried a fresh install of 5.2.29 and routing works fine.
OK, I finally fixed it!! It is related to AdminLTE (https://github.com/acacha/adminlte-laravel)
It seems that once you install it, you can remove the service provider. I opted for changing the RouteServiceProvider map method originally. When I upgraded it was overwritten. This time, I removed the service provider from app.php.
See this link for more information. https://github.com/acacha/adminlte-laravel/issues/47
Please or to participate in this conversation.