How to Upgrade Older Projects to Laravel 10

preview_player
Показать описание
A bit more philosophical and less practical video, on how I would upgrade an older project.

- - - - -
Support the channel by checking out my products:

- - - - -
Other places to follow:
Рекомендации по теме
Комментарии
Автор

I recently upgraded my company's product (250k+ lines of code) from Laravel 5.7 to Laravel 9, this is how I did it:
1. Upgrade the dependencies that can be upgraded without upgrading Laravel, and replace abandoned dependencies. This took a while, for example the libraries we used to deal with PDF and generate charts completely changed their structure from one major version to another, so we had to rewrite a lot of stuff.
2. Upgrade to Laravel 5.8, bump dependencies to versions that support 5.8
3. Upgrade to Laravel 6, bump dependencies to versions that support 6
4. and so on and so on, until Laravel 9

For each step, we of course had to rewrite some functions because of dependencies' breaking changes

wgblondel
Автор

Thank you Povilas for all the suggestions. I have been working on a project with an older laravel version and want to upgrade it so in my opinion re-creating the project from scratch is the best option.

vishalchavda
Автор

I'm working on a project that was using laravel 6... it was possible to bring it to 8.75, and I'll deliver as is because of the deadline but I realized that it's better to recreate the project! So throughout the journey, I put in a roadmap of all the functions, routes, and controllers... to make it a little bit easier to achieve a good result when I start to do that.

luispointme
Автор

For older versions prior to version 7 or 6, I would perform a fresh installation of Laravel 10. Then, I would gather all the code from the previous projects and manually install all the necessary packages. Finally, I would ensure that everything is functioning properly by conducting thorough testing, as I would during a standard upgrade.

iammuttaqi
Автор

Love your videos men. I get to learn new things every single day. God bless you

godsonmandla
Автор

Bumping up the Laravel version in your projects gives you and your customer another big advantage. This way you can also step up the used PHP version, giving the application a free and noticable power and speed boost. I mostly use Laravel Shift to make version bumps. Bringing the production servers up to PHP 8 means adding a lot of free computing power to the applications.

kreaweb-be
Автор

Thank you much for this video and for Laravel Shift! OMG. You've made my week. Month. Maybe even year! I had three 5.7 projects that needed upgrading, and I managed to manually get them all up to Laravel v8 without much trouble. But that step from v8 to v9 was a big one and it gave me fits. Then I found this video and did a double-take on Laravel Shift. What is that? I asked. Went to the website and did a V-8 headslap. For a few bucks, Shift did my (first) upgrade from Laravel 8 to 9, leaving me with only a few minor clean-up tasks, and my app is working like a charm!! Guess who's Shifting the other two apps! :D I feel like a walking commercial for Laravel Shift. :P

rottnhombre
Автор

I have used Rector PHP to upgrade code from PHP 7 to PHP 8 the noticible difference being the constructor property promotion. This make the code 'feel' modern. There are plugins for Laravel, which I haven't tried. I have used the PHP 8.0 rule (which includes ClassPropertyAssignToConstructorPromotionRector), which worked will with code that had either doc blocks or types already specified.

MichaelPritchardRR
Автор

Nice post! I planned to update my Laravel 7 app to Laravel 10. I was hoping it would be a straightforward affair of cloning my app from git repo (developed on local Mac at the time), to a laravel sail environment. But this is proving somewhat challenging, at least for the moment. Anyway, the strategy of starting from scratch, with L10 seems to make the most sense right now - I'll loop back on my journey with this.

jkbullitt
Автор

Install latest Laravel and migrate the old version code into the latest Laravel is the best approach.
Thanks Mr. Povilas Korop

ahsanrasheed
Автор

In laravel 10 and docker implementation, I found monolog related issue that the Logger class is not found and the method signatur does not match and is not comparible. Though it is not the exact message but does anyone getting such error for monolog and collision package?

mohammadashrafuddinferdous
Автор

Upgraded mine from 5.8.x to 10.x in around 1 hour, simply make an empty laravel project and then convert the routes, and move the models and some little stuff. It works!

ali_raza
Автор

Codecanyon projects have 'core' folder which 'app' folder and other folders are inside, how do they create those projects?

raymytech
Автор

Went from 5.4 to 10 in my company. Also migrated it from an IIS server to Nginx.

All in all the transition took several months. But I went through it.

patriceroy
Автор

Hi povilas,
I have a question
I have a php extension file have abstract class and some class all in same file
I wanna use it in laravel project
i tried to include the file in my controller, alao tried to use namespace for the file and i couldn't
Help me please how can i use this file

karimtarek
Автор

Hi Povilas, thanks for the video.
I use VS Code connected to GitHub and the repository connected to the live production server.
Should I create a new branch to work on the updating process or how would you do it in a case like this? Thanks in advance for your help.

augustomoradiaz
Автор

yeah true recently i was trying to upgrade an old project from v8 to v10 and found out that 2 of the packages were dead and for that reason couden't upgrade the project : (

devshakilahmed
Автор

I have a very separate question.
We use accessors in model to modify our results.
But in some cases we don't want so..
E.g if we append a field xyz using accessors and we can get our desired result but in any other place or in any other function we don't want that xyz, what you think in that case we should do

mohammadimranmir
Автор

lets say you have a project from a client that was using laravel version 7 and you opted to recreate the whole project using laravel 10, do you charge the client for that?

andywong
Автор

Question. Exactly Laravel. How important is it to consider LTS versions? How many things are different between LTS and regular version?
The latest LTS I see is version 6. It's already way too old.

Andris_Briedis