3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Laravel5.5から5.6へ更新する

Posted at

親記事

Laravelで基本的なCRUDを作る - Qiita

親記事の中で作ったLaravelアプリを更新します。

依存パッケージを更新

公式ドキュメントの指示通りにcomposer.jsonを修正します。
:link: 5.5から5.6.0へのアップグレード

composer.json
     "require": {
-        "php": ">=7.0.0",
+        "php": ">=7.1.3",
-        "fideloper/proxy": "^3.3",
+        "fideloper/proxy": "~4.0",
-        "laravel/framework": "5.5.*",
+        "laravel/framework": "5.6.*",
     },
     "require-dev": {
-        "laravel/dusk": "^2.0",
+        "laravel/dusk": "~3.0",
-        "phpunit/phpunit": "~6.0"
+        "phpunit/phpunit": "~7.0"
     },
(中略)
     "scripts": {
         "post-install-cmd": [
-            "Illuminate\\Foundation\\ComposerScripts::postInstall",
-            "php artisan optimize"
+            "Illuminate\\Foundation\\ComposerScripts::postInstall"
         ],
         "post-update-cmd": [
-            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
-            "php artisan optimize"
+            "Illuminate\\Foundation\\ComposerScripts::postUpdate"
         ],

その後、更新を実行します。

PowerShell
> composer update

漏れがないかを確認

outdatedコマンドで、他の依存パッケージに更新がないかを確認します。
composer.jsonに記載されているものの中では、mockeryに更新があるようです。

PowerShell
> composer outdated
hamcrest/hamcrest-php                 v1.2.2  ~ v2.0.0  This is the PHP port of Hamcrest Matchers
mockery/mockery                       0.9.9   ~ 1.0     Mockery is a simple yet flexible PHP mock object framework ...
phpdocumentor/type-resolver           0.4.0   ~ 0.6.1
symfony/translation                   v3.4.4  ~ v4.0.4  Symfony Translation Component

さっそく下記のようにcomposer.jsonを修正して再度updateを実行すると、失敗しました。

composer.json
-        "mockery/mockery": "0.9.*",
+        "mockery/mockery": "^1.0",

下記のログを読むと、どうやらmockeryを更新するにはhamcrest-phpの更新が必要のようです。

PowerShell
> composer update mockery/mockery
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - don't install hamcrest/hamcrest-php v2.0.0|remove hamcrest/hamcrest-php v1.2.2
    - don't install hamcrest/hamcrest-php v2.0.0|don't install hamcrest/hamcrest-php v1.2.2
    - don't install hamcrest/hamcrest-php v2.0.0|don't install hamcrest/hamcrest-php v1.2.2
    - mockery/mockery 1.0 requires hamcrest/hamcrest-php ~2.0 -> satisfiable by hamcrest/hamcrest-php[v2.0.0].
    - Installation request for mockery/mockery ~1.0 -> satisfiable by mockery/mockery[1.0].
    - Installation request for hamcrest/hamcrest-php (locked at v1.2.2) -> satisfiable by hamcrest/hamcrest-php[v1.2.2].

whyコマンドで確認すると、hamcrest-phpを使っているのはmockeryだけです。

PowerShell
> composer why hamcrest/hamcrest-php
mockery/mockery  0.9.9  requires  hamcrest/hamcrest-php (~1.1)

そこで、mockeryをインストールしなおします。

PowerShell
# 一旦削除
> composer remove --dev mockery/mockery

# 改めてインストール
> composer require --dev mockery/mockery

これで完了です。

3
2
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
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?