「Laravel5.3を用いたJosh Admin templateのインストール」でLaravel5.3を用いてJosh Admin templateのインストールしましたが、Josh Admin templateの動作環境をLaravel6(LTS)にバージョンアップします。
ファイル「composer.json」の変更
ファイル「composer.json」の内容を次の手順で変更・追加・削除します。
変更
"php": ">=7.0.0", ⇒"php": ">=7.2", "cartalyst/sentinel": "^2.0", ⇒"cartalyst/sentinel": "^3.0.0", "cviebrock/eloquent-sluggable": "^4.2", ⇒"cviebrock/eloquent-sluggable": "^6.0.0", "cviebrock/eloquent-taggable": "^3.2", ⇒"cviebrock/eloquent-taggable": "^6.0.0", "fideloper/proxy": "~3.3", ⇒"fideloper/proxy": "^4.0", "laravelcollective/html": "^5.5", ⇒"laravelcollective/html": "^6.0", "yajra/laravel-datatables-oracle": "~8.0" ⇒"yajra/laravel-datatables-oracle": "^9.6" "phpunit/phpunit": "~6.0" ⇒"phpunit/phpunit": "^8.0"
追加
"repositories": [ ・・・ { "type": "path", "url": "./infyomlabs/generator-builder" }, { "type": "path", "url": "./infyomlabs/core-templates" }
削除
"infyomlabs/core-templates": "5.3.x-dev", "infyomlabs/laravel-generator": "*", "laravel/dusk": "^2.0",
全体
{ "name": "jyostna/josh", "description": "Josh - Laravel Admin Template.", "keywords": ["framework", "laravel"], "license": "Envato Standard License", "type": "project", "repositories": [ { "type": "path", "url": "./infyomlabs/laravel-generator" }, { "type": "path", "url": "./infyomlabs/generator-builder" }, { "type": "path", "url": "./infyomlabs/core-templates" } ], "require": { "php": ">=7.2", "cartalyst/sentinel": "^3.0.0", "cviebrock/eloquent-sluggable": "^6.0.0", "cviebrock/eloquent-taggable": "^6.0.0", "doctrine/dbal": "^2.5", "fideloper/proxy": "^4.0", "infyomlabs/generator-builder": "dev-master", "infyomlabs/swagger-generator": "dev-master", "intervention/image": "^2.4 ", "laravel/framework": "6.0.*", "laravel/helpers": "^1.0", "laravel/tinker": "~1.0", "laravelcollective/html": "^6.0", "yajra/laravel-datatables-oracle": "^9.6" }, "require-dev": { "filp/whoops": "~2.0", "fzaninotto/faker": "~1.4", "mockery/mockery": "0.9.*", "phpunit/phpunit": "^8.0" }, "autoload": { "classmap": [ "database/seeds", "database/factories" ], "psr-4": { "App\\": "app/" } }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" } }, "extra": { "laravel": { "dont-discover": [ ] } }, "scripts": { "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-cmd": [ "@php artisan key:generate" ], "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover" ] }, "config": { "preferred-install": "dist", "sort-packages": true, "optimize-autoloader": true } }
ファイル「app.php」の変更
ファイル「app.php」の内容を次の手順で削除します。
削除
Laracasts\Flash\FlashServiceProvider::class, \InfyOm\Generator\InfyOmGeneratorServiceProvider::class, \InfyOm\CoreTemplates\CoreTemplatesServiceProvider::class,
Josh Admin templateにLaravel6のインストール
上記の修正完了後、Josh Admin templateをインストールしたディレクトリに移動して、次のコマンド(「composer install –no-dev」あるいは「composer update」)を使ってLaravelファイルをinstallします。
>composer update Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Package jakub-onderka/php-console-color is abandoned, you should avoid using it. Use php-parallel-lint/php-console-color instead. Package jakub-onderka/php-console-highlighter is abandoned, you should avoid using it. Use php-parallel-lint/php-console-highlighter instead. Generating optimized autoload files > Illuminate\Foundation\ComposerScripts::postAutoloadDump > @php artisan package:discover Discovered Package: cartalyst/sentinel Discovered Package: cviebrock/eloquent-sluggable Discovered Package: cviebrock/eloquent-taggable Discovered Package: fideloper/proxy Discovered Package: intervention/image Discovered Package: laravel/tinker Discovered Package: laravelcollective/html Discovered Package: nesbot/carbon Discovered Package: yajra/laravel-datatables-oracle Package manifest generated successfully.
次のコマンドでインストールされたLaravelのバージョンを確認します。
>php artisan --version Laravel Framework 6.0.4
Josh Admin templateの実行
Josh Admin templateを実行すると次のエラーが発生しました。
「laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. 」
原因は5.6からconfig/logging.phpが追加されたが、対応するファイルが設置されていないためで、「laravel/config/logging.php」からファイルを取得して設置します。