LoginSignup
4
6

More than 5 years have passed since last update.

Laravel5.3から5.4にあげてみた

Last updated at Posted at 2017-02-05

Laravel5.3から5.4にアップデート メモ

初心者の初めてのフレームワークアップデートなのでトンチンカンなことをしてる可能性があります。
ご指摘等ございましたら、是非コメントお願いします。

5.4へアップデート

プロクジェクトのルートディレクトリ

$ php artisan -V
Laravel Framework version 5.3.30

現在、5.3.30です。これを5.4.*に上げていきました。
composer.jsonのrequireの項目を変えます。

composer.json

"require": {
    "laravel/framework": "5.3.*",
    "illuminate/radis": "5.3.*"
}

を、

composer.json

"require": {
    "laravel/framework": "5.4.*",
    "illuminate/radis": "5.3.*"
}

へ。

$ composer update

を叩きましょう。これでLaravel5.4になるはずです。

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install laravel/framework v5.4.9
    - Conclusion: don't install laravel/framework v5.4.8
    - Conclusion: don't install laravel/framework v5.4.7
    - Conclusion: don't install laravel/framework v5.4.6
    - Conclusion: don't install laravel/framework v5.4.5
    - Conclusion: don't install laravel/framework v5.4.4
    - Conclusion: don't install laravel/framework v5.4.3
    - Conclusion: don't install laravel/framework v5.4.2
    - Conclusion: don't install laravel/framework v5.4.1
    - illuminate/redis v5.3.0 requires illuminate/support 5.3.* -> satisfiable by laravel/framework[v5.3.30], illuminate/support[v5.3.0, v5.3.16, v5.3.23, v5.3.4].
    - illuminate/redis v5.3.16 requires illuminate/support 5.3.* -> satisfiable by laravel/framework[v5.3.30], illuminate/support[v5.3.0, v5.3.16, v5.3.23, v5.3.4].
    - illuminate/redis v5.3.23 requires illuminate/support 5.3.* -> satisfiable by laravel/framework[v5.3.30], illuminate/support[v5.3.0, v5.3.16, v5.3.23, v5.3.4].
    - illuminate/redis v5.3.4 requires illuminate/support 5.3.* -> satisfiable by laravel/framework[v5.3.30], illuminate/support[v5.3.0, v5.3.16, v5.3.23, v5.3.4].
    - Can only install one of: laravel/framework[v5.4.0, v5.3.30].
    - don't install illuminate/support v5.3.0|don't install laravel/framework v5.4.0
    - don't install illuminate/support v5.3.16|don't install laravel/framework v5.4.0
    - don't install illuminate/support v5.3.23|don't install laravel/framework v5.4.0
    - don't install illuminate/support v5.3.4|don't install laravel/framework v5.4.0
    - Installation request for laravel/framework 5.4.* -> satisfiable by laravel/framework[v5.4.0, v5.4.1, v5.4.2, v5.4.3, v5.4.4, v5.4.5, v5.4.6, v5.4.7, v5.4.8, v5.4.9].
    - Installation request for illuminate/redis 5.3.* -> satisfiable by illuminate/redis[v5.3.0, v5.3.16, v5.3.23, v5.3.4], laravel/framework[v5.3.30].

ならなかった。
illuminate/radisが対応してないみたいなので5.3から5.4にします。

composer.json

"require": {
    "laravel/framework": "5.4.*",
    "illuminate/radis": "5.4.*"
}

もう一度アップデートします。

$ composer update

成功しました。
5.4になっているか確認しましょう。

$ php artisan -V
Laravel Framework 5.4.9

よっしゃ!!

5.4にアップデートしてからやったこと

5.3から色々変わっているみたいです。

Laravel公式ドキュメント 5.4 Upgrade Guide
https://readouble.com/laravel/5.4/en/upgrade.html

Laravel 5.4変更点メモ (qiita)
http://qiita.com/a_yasui/items/2d840ed9f25c1fa92981

とりあえず自分のアプリが動くか試してみました。

ErrorException in bd8da9c618dd865057aa28cddce0ffd60ee405cf.php line 61:

Call to undefined method Illuminate\View\Factory::getFirstLoop() 
(View: /home/vagrant/Code/robbin/resources/views/home.blade.php)

動きません。
公式ドキュメントによると、

After upgrading all packages, you should run php artisan view:clear
to avoid Blade errors related to the removal of Illuminate\View\Factory::getFirstLoop(). 
In addition, you may need to run php artisan route:clear to flush
the route cache.

とのことなので実行します。

$ php artisan view:clear
Compiled views cleared!

とりあえずこれで私のプロジェクトは動くようになりました。

追記

他の環境でアップデートしようとcomposer updateしたところ、こんなエラーが出ました。

PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined method Illuminate\Events\Dispatcher::dispatch() in 
/home/vagrant/Code/robbin/vendor/laravel/framework/src/Illuminate/Con
sole/Application.php:56
"your app"/bootstrap/cache/compiled.php

を削除したところ動くようになりました。

4
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
6