Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Comments for my Upgrading Laravel 4 to Laravel 5 post

Please note any missing pieces, wrong directions, or anything else in the comments. Thanks!

This is trying to catch all framework-related changes that are missing from my post RE upgrading Laravel 4 to 5.

@stygiansabyss

This comment has been minimized.

Copy link

commented Jan 15, 2015

Might want to change the copy configs over bit. Instead suggest they go through file by file and copy the values over as needed. A quick check showed 2 changes already, likely more than this, just checked 2 main configs to see.

config/app.php => new key 'log'
config/database.php => 'remember' key was changed to 'password'

@mattstauffer

This comment has been minimized.

Copy link
Owner Author

commented Jan 16, 2015

Great note on that @StygianAbyss. Please, if anyone else notices any more of these, list them here.

@tomschlick

This comment has been minimized.

Copy link

commented Jan 16, 2015

For requiring illuminate/html you can use "~5.0" as the version instead of dev-master

@mattstauffer

This comment has been minimized.

Copy link
Owner Author

commented Jan 16, 2015

Thanks @tomschlick; updated it.

@lynxtdc

This comment has been minimized.

Copy link

commented Jan 16, 2015

Hey Matt: Any tips on bringing over Form Macros?

@iWader

This comment has been minimized.

Copy link

commented Jan 16, 2015

When you mention about the models folder, you shouldn't need to add the the autoloader as everything under app/ is autoloaded under PSR-4.

@mattstauffer

This comment has been minimized.

Copy link
Owner Author

commented Jan 16, 2015

@iWader Thanks! However, if it was in the app/models directory in your old site, it's very likely that it was in the global namespace. app/models/User.php in PSR-4 would be the Model\User class, which isn't what the vast majority of people have when they have a Laravel 4 models directory. Hope that makes sense!

@mattstauffer

This comment has been minimized.

Copy link
Owner Author

commented Jan 16, 2015

@lynxtdc Nope--someone more familiar with Form Macros will have to chip in and then I'll update the guide. Sorry!

@lynxtdc

This comment has been minimized.

Copy link

commented Jan 16, 2015

Thanks Matt

@dustingraham

This comment has been minimized.

Copy link

commented Feb 12, 2015

@mattstauffer @iWader The app/models folder was in the autoload classmap, but I think the idea here is that we need an additional namespace to prefix everything. I.E. I have a folder in L4 app/models/stuff/Thing.php which is namespace Stuff; and when copying stuff/* into the new Laravel 5 app/ folder app/stuff/Thing.php my namespace needs to prefix App (right?) so namespace App\Stuff; is what I'm understanding. Will attempt it soon.

@travisulrich

This comment has been minimized.

Copy link

commented Mar 5, 2015

@mattstauffer Thanks for putting this list together. Very helpful. Two little things that I came across when upgrading:

  • Str alias has been removed from default config/app.php. Most of the string functions are included in Illuminate\Support\Helpers or just add 'Str' => 'Illuminate\Support\Str' back in to the alias array
  • Paginator class has changed considerably. For simple/default uses, links() function can just be changed to render()
@jtgrimes

This comment has been minimized.

Copy link

commented Jul 14, 2015

@mattstauffer I know I'm late to this party, but I finally moved a site over today and found a couple steps I had to do - we'll see if this helps anyone.

Because we're not creating the project via composer, there are a couple commands that composer doesn't run for us and that we have to do by hand.

First, we need a .env file that Laravel is happy with. The easiest way to get one is to run cp .env.example .env. You can then update the new .env file with your settings as described in the article.

We need that .env file in place for the next step. Laravel requires that you set your application key, otherwise you'll get the following error: No supported encrypter found. The cipher and / or key length are invalid. To set the key, just run php artisan key:generate and a random key will be generated and placed in the .env file.

@Rjs37

This comment has been minimized.

Copy link

commented Sep 30, 2015

@mattstauffer Incredibly late to the party, but I've got a couple of comments to make.

First, thanks for the article, it's been a huge help in upgrading my sites and the accompanying package that I use.

Having worked through it all, I'd possibly clarify the git squash comments. Having never used it before, it took me a little while to realize that I didn't need to squash the first of the 3 commits (based on the example of 3 commits that you mentioned). I was trying to squash all 3 rather than just the latter ones. Incredibly useful feature though :)

Also the comment from @jtgrimes could definitely do with being added to the instructions.

@ajcastro

This comment has been minimized.

Copy link

commented Jan 11, 2018

@mattstauffer, I run the command git merge laravel/master --squash but it errors

fatal: refusing to merge unrelated histories

How to solve this please?

@ajcastro

This comment has been minimized.

Copy link

commented Jan 11, 2018

^solved via --allow-unrelated-histories option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.