We use cookies to keep our site relevant and easy to use, your continued use of this site is consent that we may set several cookies (see our Privacy & Cookie Policy), click to always allow cookies from our site (and not see this notifcation on your next visit) or read more.Allow Cookies

EU legislation requires that all websites clearly specify if cookies are being used and their purpose, You can read more about how we use cookies (and which cookies we use) in our Privacy and Cookie Policy.

You will see this notification the first time you visit our website unless you accept cookies (in which case we'll set a cookie to remember thay you're happy for us to to set cookies!).

Laravel 5 – Handling laravel/laravel updates

It’s been a while since my first post about Laravel, I’ve learnt a lot recently (mostly from Laracasts and Dayle Rees) but yesterday stumbled on a real problem with how the project was setup, so thought I’d cover here what I did to fix it.

Laravel consists of two parts:

When you do a composer install of laravel/laravel you get the current copy of the files, and the laravel/framework becomes a dependency managed by composer.

Laravel is in pretty active development and Laravel 5 particularly isn’t released yet, so there are regular changes to things.

What I encountered yesterday was a situation where both parts of Laravel were updated, in fact some code moved from laravel/framework to laravel/laravel, running the composer update meant that the framework got updated but everything was broken because I didn’t have the necessary changes in laravel/laravel.

I did a LOT of reading and these two posts were of the most interest:

I quite fancied doing this as a rebase, but when I tried to do it I got into a real mess with merges and couldn’t make it work, so I went down this route:

  • Cloned the laravel/laravel develop branch (now known as laravel5-fresh).
  • Did a git pull to make sure I’d got the latest versions
  • Started a new feature with git flow in Sourcetree
  • Copied all the files from my laravel5-fresh over the top of my working project directory.
  • Ran composer update in my working project directory.
  • Looked at the working copy of my project in Sourcetree
    • Where it was laravel/laravel code I committed the change.
    • Where my code had been wiped out by the copy I discarded it.
  • Finished up my feature in git flow.

This isn’t the cleanest way, I’d be happier if it was a merge or a rebase done properly but this feels like it works and allows me to see exactly which laravel changes were in that update.

 

 

 

 

This entry was posted on Friday, January 23rd, 2015 at 1:51 pm and is filed under PHP, Quick Posts. You can follow any responses to this entry through the RSS 2.0 feed.