How to Upgrade Older Projects to Laravel 10

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ธ.ค. 2024

ความคิดเห็น • 69

  • @wgblondel
    @wgblondel ปีที่แล้ว +17

    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

    • @chuckpeck8124
      @chuckpeck8124 5 หลายเดือนก่อน

      Do you know how many hours it took to upgrade? I'm looking at a project written in Laravel 4.2 and moving it to the latest version. Any insight would be helpful as we need to provide a budget for this work.

  • @vishalchavda2931
    @vishalchavda2931 ปีที่แล้ว +5

    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.

  • @luispointme
    @luispointme ปีที่แล้ว +11

    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.

    • @twentyhate
      @twentyhate ปีที่แล้ว +4

      yeah going from laravel 6 to 10 is going to be a pain you should just copy paste all of your files to a new version at this point

  • @iammuttaqi
    @iammuttaqi ปีที่แล้ว +8

    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.

    • @amirolzolkifli
      @amirolzolkifli ปีที่แล้ว +1

      I did this for every upgrade.

  • @ahsanrasheed5953
    @ahsanrasheed5953 ปีที่แล้ว

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

  • @kreaweb-be
    @kreaweb-be ปีที่แล้ว +2

    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.

  • @ali_raza
    @ali_raza ปีที่แล้ว +16

    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!

    • @programmingmindset
      @programmingmindset ปีที่แล้ว

      This is the best way. I always follow this

    • @OliverKurmis
      @OliverKurmis ปีที่แล้ว

      How many lines of code is this project?

    • @ali_raza
      @ali_raza ปีที่แล้ว +2

      @@OliverKurmis around 40K

    • @joshuaverniealecha133
      @joshuaverniealecha133 ปีที่แล้ว

      Can you help me upgrade my project to the latest version?

    • @theemperor8063
      @theemperor8063 6 หลายเดือนก่อน

      Is there a video or tutorial for it, i had no idea about wht u say

  • @godsonmandla6658
    @godsonmandla6658 ปีที่แล้ว +1

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

  • @rottnhombre
    @rottnhombre ปีที่แล้ว +2

    Thank you SOOOOO 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 toooooo 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

  • @jkbullitt8986
    @jkbullitt8986 11 หลายเดือนก่อน

    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.

  • @MichaelPritchardRR3
    @MichaelPritchardRR3 ปีที่แล้ว +1

    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.

  • @patriceroy7238
    @patriceroy7238 ปีที่แล้ว +1

    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.

  • @raymytech
    @raymytech ปีที่แล้ว

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

  • @andywong2244
    @andywong2244 ปีที่แล้ว +1

    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?

  • @mohammadashrafuddinferdous9347
    @mohammadashrafuddinferdous9347 ปีที่แล้ว

    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?

  • @mohammadimranmir5037
    @mohammadimranmir5037 ปีที่แล้ว

    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

    • @LaravelDaily
      @LaravelDaily  ปีที่แล้ว

      Hard to say without exact code example. Maybe you named accessor the same as database field? You should name them differently

  • @augustomoradiaz
    @augustomoradiaz ปีที่แล้ว

    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.

    • @LaravelDaily
      @LaravelDaily  ปีที่แล้ว

      I don't use vs code so I can't comment

    • @augustomoradiaz
      @augustomoradiaz ปีที่แล้ว

      @@LaravelDaily Povilas thanks for your reply, perhaps is more a git question than a VS Code one. Your video sets the idea in my mind of upgrading my project. But I'm afraid of taking down the website for days and this site is my way of living. I have to learn more to be sure before trying the upgrade. Thanks again.

  • @karimtarek940
    @karimtarek940 ปีที่แล้ว

    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

    • @LaravelDaily
      @LaravelDaily  ปีที่แล้ว

      Can't answer in a comment, this situation needs debugging

  • @programmingmindset
    @programmingmindset ปีที่แล้ว +1

    The best method is
    1. install a empty laravel 10 project and copy composer.json file
    2. make a backup of your old composer.json of old project
    3. replace your existing composer.json with new laravel 10's composer.json
    4. update your cmd/terminal php 8.1
    5. finally its time to run : composer update
    6. after that, fixed some error if arises
    😎😎😎😎

  • @Andris_Briedis
    @Andris_Briedis ปีที่แล้ว

    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.

    • @LaravelDaily
      @LaravelDaily  ปีที่แล้ว

      In terms of Laravel, LTS is not important at all, it's best to use the latest version all the time, but all versions have 2 year support.

  • @MahmoudDiab-ok1hs
    @MahmoudDiab-ok1hs ปีที่แล้ว

    In my opinion the best way is to create a new Laravel project and transfer all logic and install all packages then edit the legacy code , I upgraded Laravel project from 7 to 10. the worst thing is the packages but by searching everything will be fine

  • @isafwa1
    @isafwa1 ปีที่แล้ว

    What do you think about pinia ORM?

    • @isafwa1
      @isafwa1 ปีที่แล้ว

      The methods naming of models & queries is oriented from laravel.

    • @LaravelDaily
      @LaravelDaily  ปีที่แล้ว

      Haven't used it

  • @gilney.mathias
    @gilney.mathias ปีที่แล้ว +1

    Where i work on we are still using 5.5 😅

  • @lorenzolorinikalil5734
    @lorenzolorinikalil5734 ปีที่แล้ว +2

    I recently updated a project from 5.5 to 9, almost a month to complete te update and many sleepless nights, i considered laravel shift but the prices were crazy, almost 200 dollars for the whole project

    • @wgblondel
      @wgblondel ปีที่แล้ว +3

      For a company, 200$ is must cheaper than a month of work

  • @SalmanKhan-fn7nj
    @SalmanKhan-fn7nj ปีที่แล้ว

    Hy , sir can u please add a vedio of how to update lower version of laravel and php with its dependencies

    • @LaravelDaily
      @LaravelDaily  ปีที่แล้ว +1

      In this video, I specifically said why I'm not going to shoot that longer video

    • @SalmanKhan-fn7nj
      @SalmanKhan-fn7nj ปีที่แล้ว

      But sir with due respect pls its my request to upload a crud with search functionality, using react redux toolkit and laravel api pls, also im requesting for how to run any project with its dependencies, being in higher version of php and laravel..
      Please sir

    • @LaravelDaily
      @LaravelDaily  ปีที่แล้ว

      Sorry you're asking for too much

  • @devitosolucoes7534
    @devitosolucoes7534 ปีที่แล้ว

    Hi, how are you? Any ideas where I can find laravel jobs online? mid level (5ys). Ty

    • @LaravelDaily
      @LaravelDaily  ปีที่แล้ว +1

      I recently started this area on LaravelDaily laraveldaily.com/jobs/offers

    • @devitosolucoes7534
      @devitosolucoes7534 ปีที่แล้ว

      @@LaravelDaily thank you!

    • @pabblo89pl
      @pabblo89pl ปีที่แล้ว

      Where're you from?

  • @devshakilahmed
    @devshakilahmed ปีที่แล้ว

    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 : (

  • @salahaldain_gli
    @salahaldain_gli 27 วันที่ผ่านมา

    Excuse me guys , How can I run a Laravel project from version 5 on my computer? Just run it in order to access the scripts that I will build in my project via Laravel 11.

    • @LaravelDaily
      @LaravelDaily  27 วันที่ผ่านมา

      If you have newer php version, you won't be able to run Laravel 5 project, unfortunately. But you can still read the files in the editor and copy their content, no?

    • @salahaldain_gli
      @salahaldain_gli 27 วันที่ผ่านมา

      what if I use another windows interface and downloaded an old version of php what is the old version that is compatible with laravel 5?

    • @LaravelDaily
      @LaravelDaily  25 วันที่ผ่านมา +1

      I don't remember by this point, please google Laravel 5 docs and see the installation requirements.

    • @salahaldain_gli
      @salahaldain_gli 25 วันที่ผ่านมา

      @@LaravelDaily thank you dear teacher.

  • @raimonds.L
    @raimonds.L ปีที่แล้ว

    It's not that easy. I have a project which uses webpack, datatables, fomantic-ui. The old webpack kind off compiles everything and that's not the case with vite. everything has to be exported and old vendor js libraries can't (or I can't)

  • @Joe_Aki
    @Joe_Aki ปีที่แล้ว

    Some people think that if you are in a project that is too old (like technical debt), you should get out of the project.
    By any chance, it’s kinda waste of time.

  • @valentinvalev2223
    @valentinvalev2223 ปีที่แล้ว +2

    Rule #1 - if it works - don't touch it

    • @LaravelDaily
      @LaravelDaily  ปีที่แล้ว +2

      Until it doesn't work :)

    • @rottnhombre
      @rottnhombre ปีที่แล้ว

      until someone hacks you? lol

  • @andriamasy
    @andriamasy ปีที่แล้ว

    Super

  • @DanielSpindler-gc7xh
    @DanielSpindler-gc7xh ปีที่แล้ว

    sadly upgrading laravel is always such a hassle. doesnt seem like it wants to be upgraded

  • @raymytech
    @raymytech ปีที่แล้ว

    I'm coming from laravel 5.6

  • @ArtanEmini
    @ArtanEmini ปีที่แล้ว

    Pita 😭

  • @GamePlayByFaks
    @GamePlayByFaks ปีที่แล้ว

    rather, easy to do upgrade create draft laravel 10, and copy everything to new project and do the fixes rather easy...

    • @GamePlayByFaks
      @GamePlayByFaks ปีที่แล้ว +1

      and if neeed fork packages and bump them to support laravel 10 :)).