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.
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.
Great note on that @StygianAbyss. Please, if anyone else notices any more of these, list them here.
For requiring illuminate/html you can use "~5.0" as the version instead of dev-master
Thanks @tomschlick; updated it.
Hey Matt: Any tips on bringing over Form Macros?
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.
@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!
@lynxtdc Nope--someone more familiar with Form Macros will have to chip in and then I'll update the guide. Sorry!
Thanks Matt
@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.
@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 arraylinks()
function can just be changed to render()
@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.
@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.
@mattstauffer, I run the command git merge laravel/master --squash
but it errors
fatal: refusing to merge unrelated histories
How to solve this please?
^solved via --allow-unrelated-histories
option
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'