Back

Next week I have to start an update of a Laravel API written with version 7 to version 11. I'm thinking of creating a new project then porting over the code then updating what's needed. Think it might be the less painful action.

What say you fellow Laravel Devs? Is there a better approach I'm missing?

5 • •

535

•

We used both Shift and the new project approach on different projects. Shift is great when the old project uses a lot of deprecated or broken methods, but it does not update the project's architecture to match Laravel 11's new structure (which is not a problem at all, in fact).

So, if your API is mostly constituted of simple controllers & models, a new installation would be as easy as Shifting, with the benefit of continuing with an up-to-date project architecture.

On a side note, I'd like to add that migrating an old project to a new installation is a great way to review the project's code, giving more insights on what may need to be reworked.

1 • •

72

•
In response to @toonvandenbos

Your last paragraph is a brilliant shout. With the codebase being a few years old, it could do with a good review to see what can be improved.

As for the complexity of the project as a whole, it's fairly straightforward with simple models and controllers along with quite a few jobs that Laravel Horizon keeps an eye on. It uses the laravel-permission package from Spatie which will need updating but that's about the most complicated part. It might be a good project for me to use as my first go with Shift...🤔

• •

25

•
  • No matching results...
  • Searching...

/ 1000