Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

salkfdhjkh's avatar

Upgrade to 5.3

I am upgrading a 5.2 project to 5.3 and intend to then upgrade to 5.4. After composer update to 5.3, I note that the new Routes/web.php directory and file have not been generated. I can see in the RouteServiceProvider that the original route.php file is called so routes are working.

I am quite new to Laravel so I am a not sure as to what will happen when I deploy. I have the live site on Fortrabbit and deploy with git and composer is run automatically on any composer.json changes when pushed up.

My concerns are ampified by the fact that I had to manually uninstall a package (squareboat/sneaker) for my local composer update to work. I expect I can do the same on the production server prior to pushing my changes.

So my question is, should I be manually replicating the Routes/web.php locally prior to pushing the changes to the production server? I thought the composer update would do such.

0 likes
7 replies
salkfdhjkh's avatar

@jlrdw , you can be assured backing up was the first thing I did.

My main concern is whether I should manually create the Routes/web.php file. Will doing so make my file structure more compatible with future upgrades?

I note your suggestions from the other post and understand those options, thanks for that. At this stage I am quite new to all this development stuff so I want to go through the upgrade process to get the hang of it.

jlrdw's avatar

You mean manually type them in or use Artisan? I guess I am old school, I like doing my own. But either way, some routes aren't hard to change in future. example in another framework had

Router::any('admin', 'Controllers\Admin@admin');

where later it changed to

Router::any('admin', 'app\Controllers\Admin@admin');

just basically a namespace change.

salkfdhjkh's avatar

5.3 docs say that there is a routes directory under root with web.php and other route related files. My upgrade has not created that directory or files.

So yes, I mean manually create them and transfer all my current routes. The question is, would this be sensible given that I will then be upgrading to 5.4.

I know it seems like I may be making work for myself in doing so (ie rather than an install straight to 5.4) but I want familiarise myself with the process.

jlrdw's avatar
jlrdw
Best Answer
Level 75

I just went from 5.1 to 5.4, now there's a web folder for web routes, really took no time to do some simple cut / paste. I didn't upgrade, I just installed fresh and worked code over. It can be a 2 or three day process.

The trick to it is learn about a newer version prior to using it in production, makes migrating stuff easier. Meaning manually changing code where necessary.

salkfdhjkh's avatar

OK, thanks. I'll try it manually and see how it goes.

As an aside, the reason I want to be familiar with this is that I see the upgrade process as one of the main downsides to me using Laravel. I live in a fairly remote part of Australia and the small businesses I get as customers do not understand such ongoing costs.

jlrdw's avatar

@coldpizza I wouldn't worry about the upgrading so often, there are still older 4.2 sites in production. I'd explain all to customers up front, and let them choose to stay up to date or not.

Eventually though there's a forced update if a host no longer supports a certain php version. Most host will hold on to an older version for a while longer due to so many production sites. There hopefully security is up to date.

Please or to participate in this conversation.