6
3

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から一気にLaravel6.0へアプデ

Posted at

メモ

snake_case()
studly_case()
str_singular()
str_random()
str_plural()
array_pluck()

が無くなった。
というか、ヘルパがごっそり変わった。

use Illuminate\Support\Str;
use Illuminate\Support\Arr;

Str::snake()
Str::studly()
Str::singular()
Str::random()
Str::plural()
Arr::pluck()

array_except

で怒られる。

viewのキャッシュクリアでおk

php artisan view:clear

str_slug

で怒られる。

どこかにテストで新規Laravel6プロジェクトを作成して、
config/cache.php
config/session.php
をLaravel6のファイルで上書きする(これらを変更している場合はその変更を反映させる)。

composer create-project "laravel/laravel=^6.0" laravel6test

viewのページング部分がレイアウトあたっていない。

デフォルトで、bootstrap-4.blade.phpというファイルが使用されるようになった。
ので、ファイル名を変えるか、ファイルを指定する。
今後も変更あるかもしれないので、指定したほうが無難。

{{ $documents->appends(request()->input())->links('vendor/pagination/default') }}

laravelcollective/htmlを使用している場合、
GETで送信した際にフォームに初期値がセットされない。

ビューに下記を追加

Form::considerRequest(true);

Laravelのログを見ると、

laravel.EMERGENCY: Unable to create configured logger. Using emergency logger.

で怒られている。

どこかにテストで新規Laravel6プロジェクトを作成して、
config/logging.php
を持ってきて置く。


Access level to App\Http\Requests\CustomRequest::validationData() must be public (as in class Illuminate\Foundation\Http\FormRequest)

で怒られる。

該当のfunctionをpublicにする


なんかエラー画面が出ない

Call to undefined method Whoops\Run::appendHandler()

でいっぱい怒られてる。

そもそもエラー画面が新しくなっている。
composer.jsonのrequire-devを新しくする。

    "require-dev": {
        "facade/ignition": "^1.4",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^3.0",
        "phpunit/phpunit": "^8.0"
    },

さらに、composer updateの際に

Class 'Symfony\Thanks\GitHubClient' not found

で怒られる。

composer.jsonのscriptsを新しくする。

    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    },

artisan optimizeで失敗する。

The command "php artisan optimize" failed.


optimizeは削除する。


DBに接続できない

.envのパスワードに#やら入ってませんか?
そんなときは、クオーテーションでエスケープしましょう。

DB_PASSWORD="1234#56789"

やっといたほうが良さそうな変更

5.7から以下の変更がされています。

新しくdataディレクトリがstorage/framework/cacheへ追加されました。このディレクトリをアプリケーションに作成してください。

mkdir -p storage/framework/cache/data

次に、新しく作成したdataディレクトリへ、.gitignoreファイルを追加してください。

cp storage/framework/cache/.gitignore storage/framework/cache/data/.gitignore

最後にstorage/framework/cache/.gitignoreファイルを以下のように確実に更新してください。

*
!data/
!.gitignore
6
3
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
6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?