Skip to content

Instantly share code, notes, and snippets.

@mattstauffer
Last active January 11, 2018 02:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattstauffer/4203242322e4e494e189 to your computer and use it in GitHub Desktop.
Save mattstauffer/4203242322e4e494e189 to your computer and use it in GitHub Desktop.
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.

@dustingraham
Copy link

@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
Copy link

@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
Copy link

@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
Copy link

Rjs37 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
Copy link

ajcastro 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
Copy link

^solved via --allow-unrelated-histories option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment