Skip to content

[phpライブラリ] 2ブランチのLaravel9を10へアップデート #2191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
May 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
32943ae
change: phpライブラリ, laravel9→10へアップデート
akagane99 May 4, 2025
c725268
comment: laravel10, コメントアウトされたコードのdispatch_now → dispatch_syncに切替
akagane99 May 4, 2025
e86c2d7
change: laravel10, AuthServiceProviderのregisterPoliciesメソッドをフレームワークが自…
akagane99 May 4, 2025
b76e9a4
change: laravel10, モデルの$dates → $castsに切替(Laravel10.xで$date廃止に対応)
akagane99 May 4, 2025
d9c3f06
change: laravel10, App\Http\Kernelクラスの$routeMiddlewareプロパティは、その目的をよりよ…
akagane99 May 4, 2025
5e8f9ad
change: laravel10, GitHubのソース差分対応 laravel/laravel/compare/9.x...10.x
akagane99 May 4, 2025
5dfb2d8
change: laravel10, github actionsをphp8.1に変更
akagane99 May 4, 2025
1a185e8
change: laravel10, GitHubのソース差分対応 laravel/laravel/compare/9.x...10.x
akagane99 May 4, 2025
f3174b2
change: laravel10, GitHubのソース差分対応 laravel/laravel/compare/9.x...10.x
akagane99 May 4, 2025
12462e6
change: laravel10, Userモデルのpassword に hashed という cast タイプを対応
akagane99 May 4, 2025
51ac7a2
change: laravel10, GitHubのソース差分対応 laravel/laravel/compare/9.x...10.x
akagane99 May 4, 2025
826278a
change: laravel10, GitHubのソース差分対応 laravel/laravel/compare/9.x...10.x
akagane99 May 4, 2025
bcdf08b
change: laravel10, 多言語ファイルの移動
akagane99 May 5, 2025
0e4edeb
change: laravel10, GitHubのソース差分対応 laravel/laravel/compare/9.x...10.x
akagane99 May 5, 2025
a72183f
change: laravel10, .envのMAIL_DRIVER → MAIL_MAILERに修正
akagane99 May 5, 2025
5392821
Update CC ver.2.27.0.1
akagane99 May 5, 2025
3b626e0
change: laravel10, DB::raw()の使い方修正
akagane99 May 6, 2025
3d5b9b0
change: laravel10, dusk, 警告対応(WARN Your XML configuration validates …
akagane99 May 9, 2025
ca621e5
change: laravel10, composer-dev.jsonのduskを7→8にアップデート
akagane99 May 9, 2025
aa2c346
test: laravel10, github actions, Test file "no_manual" not foundエラー対応…
akagane99 May 9, 2025
ebdb564
test: laravel10, github actions, Upgrade Chrome Driverコマンド修正
akagane99 May 9, 2025
d96d953
test: laravel10, dusk, envからDUSK_DRIVER_URLを取得できるよう修正
akagane99 May 9, 2025
6da54b9
test: laravel10, dusk, envからDUSK_NO_MANUAL/DUSK_NO_API_TESTを設定できるように対応
akagane99 May 9, 2025
ddcd686
test: laravel10, github actions, Test file "no_manual"|"no_api_test" …
akagane99 May 9, 2025
99d863e
test: laravel10, github actions, Test file "no_manual"|"no_api_test" …
akagane99 May 9, 2025
acdcd47
test: laravel10, github actions, Test file "no_manual"|"no_api_test" …
akagane99 May 11, 2025
a9239a5
test: laravel10, github actions, Test file "no_manual"|"no_api_test" …
akagane99 May 11, 2025
2bc1478
revert: laravel10, 多言語ファイルの移動
akagane99 May 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
Expand Down Expand Up @@ -168,6 +168,14 @@ FACE_AI_API_KEY="${COMMON_API_KEY}"

# --- Connect-CMS Dusk option

#DUSK_DRIVER_URL=

# Do not create manuals in Dusk.
#DUSK_NO_MANUAL_ALL=true

# Do not run API tests in Dusk.
#DUSK_NO_API_TEST_ALL=true

# dusk use uploads dir.
#UPLOADS_DIRECTORY_BASE=uploads_dusk/

Expand Down
16 changes: 12 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
* text=auto eol=lf

*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php

/.github export-ignore
CHANGELOG.md export-ignore
.styleci.yml export-ignore

# Connect-CMS
*.bat text eol=crlf
47 changes: 26 additions & 21 deletions .github/workflows/laravel_dusk_connect-cms-test-matrix-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1']
php: ['8.1', '8.2', '8.3']

name: ubuntu-latest-mysql PHP ${{ matrix.php }}

Expand All @@ -45,6 +45,10 @@ jobs:
sed -i -e 's|PDF_THUMBNAIL_API_URL=""|PDF_THUMBNAIL_API_URL="http://localhost:8000"|g' .env
sed -i -e 's|FACE_AI_API_URL=""|FACE_AI_API_URL="http://localhost:8000"|g' .env
# sed -e "$ a MANUAL_PUT_BASE=\"$GITHUB_WORKSPACE/tests/Manual/html/\"" .env
# マニュアル出力しない
sed -i -e 's|#DUSK_NO_MANUAL_ALL=true|DUSK_NO_MANUAL_ALL=true|g' .env
# APIテストを実行しない
sed -i -e 's|#DUSK_NO_API_TEST_ALL=true|DUSK_NO_API_TEST_ALL=true|g' .env

# schedule でphpバージョン指定
# - name: Set if input php_version is empty
Expand Down Expand Up @@ -127,9 +131,10 @@ jobs:
- name: Chrome Version
run: /opt/google/chrome/chrome --version

# https://readouble.com/laravel/8.x/ja/dusk.html#managing-chromedriver-installations
#- name: Upgrade Chrome Driver
# run: php artisan dusk:chrome-driver `/opt/google/chrome/chrome --version | cut -d " " -f3 | cut -d "." -f1`
# https://readouble.com/laravel/10.x/ja/dusk.html#managing-chromedriver-installations
- name: Upgrade Chrome Driver
# run: php artisan dusk:chrome-driver `/opt/google/chrome/chrome --version | cut -d " " -f3 | cut -d "." -f1`
run: php artisan dusk:chrome-driver --detect

# https://stackoverflow.com/questions/76980975/chrome-driver-failing-in-laravel-dusk-failed-to-open-stream-http-request-fai
# https://voicetechno-jp.secure-web.jp/ChromeDriverV115orNewer.html
Expand All @@ -145,24 +150,24 @@ jobs:
# - name: Downgrade Chrome driver to v114
# run: php artisan dusk:chrome-driver 114

- name: Set env CHROME_VERSION
run: |
echo CHROME_VERSION=`/opt/google/chrome/chrome --version | cut -d " " -f3 | cut -d "." -f1` >> $GITHUB_ENV
# - name: Set env CHROME_VERSION
# run: |
# echo CHROME_VERSION=`/opt/google/chrome/chrome --version | cut -d " " -f3 | cut -d "." -f1` >> $GITHUB_ENV

# https://github.com/browser-actions/setup-chrome (community)
- name: Download Chrome and Chrome Driver(use Chrome Driver Only)
uses: browser-actions/setup-chrome@v1
id: setup-chrome
with:
chrome-version: ${{ env.CHROME_VERSION }}
install-chromedriver: true
# - name: Download Chrome and Chrome Driver(use Chrome Driver Only)
# uses: browser-actions/setup-chrome@v1
# id: setup-chrome
# with:
# chrome-version: ${{ env.CHROME_VERSION }}
# install-chromedriver: true

- name: Chrome Driver Copy
run: sudo \cp -f ${{ steps.setup-chrome.outputs.chromedriver-path }} ./vendor/laravel/dusk/bin/chromedriver-linux
# - name: Chrome Driver Copy
# run: sudo \cp -f ${{ steps.setup-chrome.outputs.chromedriver-path }} ./vendor/laravel/dusk/bin/chromedriver-linux

- name: Chrome Driver Permission Denied 対応
run: |
sudo chmod +x ./vendor/laravel/dusk/bin/chromedriver-linux
# - name: Chrome Driver Permission Denied 対応
# run: |
# sudo chmod +x ./vendor/laravel/dusk/bin/chromedriver-linux

- name: Start Chrome Driver
run: ./vendor/laravel/dusk/bin/chromedriver-linux --port=9515 &
Expand All @@ -175,9 +180,9 @@ jobs:
# - 事前準備用の実行
# ---------------------------------------------

- name: 'Run Dusk データ準備用 - ログ管理 - マニュアルなし'
- name: 'Run Dusk データ準備用 - ログ管理'
if: always()
run: php artisan dusk tests/Browser/Manage/LogManageTest.php no_manual
run: php artisan dusk tests/Browser/Manage/LogManageTest.php

# ---------------------------------------------
# - 設計 ①
Expand Down Expand Up @@ -345,7 +350,7 @@ jobs:

- name: 'Run Dusk スライドショー'
if: always()
run: php artisan dusk tests/Browser/User/SlideshowsPluginTest.php no_api_test
run: php artisan dusk tests/Browser/User/SlideshowsPluginTest.php

- name: 'Run Dusk 開館カレンダー'
if: always()
Expand Down
30 changes: 16 additions & 14 deletions .github/workflows/laravel_dusk_connect-cms-test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.0', '8.1', '8.2']
php: ['8.1', '8.2', '8.3']

name: ubuntu-latest-mysql PHP ${{ matrix.php }}

Expand All @@ -44,6 +44,8 @@ jobs:
sed -i -e 's|TRANSLATE_API_URL=""|TRANSLATE_API_URL="http://localhost:8000"|g' .env
sed -i -e 's|PDF_THUMBNAIL_API_URL=""|PDF_THUMBNAIL_API_URL="http://localhost:8000"|g' .env
sed -i -e 's|FACE_AI_API_URL=""|FACE_AI_API_URL="http://localhost:8000"|g' .env
sed -i -e 's|#DUSK_NO_MANUAL_ALL=true|DUSK_NO_MANUAL_ALL=true|g' .env
sed -i -e 's|#DUSK_NO_API_TEST_ALL=true|DUSK_NO_API_TEST_ALL=true|g' .env
# sed -e "$ a MANUAL_PUT_BASE=\"$GITHUB_WORKSPACE/tests/Manual/html/\"" .env

# schedule でphpバージョン指定
Expand Down Expand Up @@ -127,21 +129,21 @@ jobs:
- name: Chrome Version
run: /opt/google/chrome/chrome --version

# https://readouble.com/laravel/9.x/ja/dusk.html#managing-chromedriver-installations
# https://readouble.com/laravel/9.x/ja/dusk.html#running-tests-on-github-actions
# https://readouble.com/laravel/10.x/ja/dusk.html#managing-chromedriver-installations
# https://readouble.com/laravel/10.x/ja/dusk.html#running-tests-on-github-actions
# Chrome Version と Chrome Driverを同じにする
- name: Upgrade Chrome Driver
# run: php artisan dusk:chrome-driver --detect
run: php artisan dusk:chrome-driver --detect
# run: php artisan dusk:chrome-driver `/opt/google/chrome/chrome --version | cut -d " " -f3 | cut -d "." -f1`
run: php artisan dusk:chrome-driver `/opt/google/chrome/chrome --version | cut -d " " -f3`
# run: php artisan dusk:chrome-driver `/opt/google/chrome/chrome --version | cut -d " " -f3`

- name: Chrome Driver Copy
run: sudo \cp -f ./vendor/laravel/dusk/bin/chromedriver-linux64/chromedriver ./vendor/laravel/dusk/bin/chromedriver-linux
# - name: Chrome Driver Copy
# run: sudo \cp -f ./vendor/laravel/dusk/bin/chromedriver-linux64/chromedriver ./vendor/laravel/dusk/bin/chromedriver-linux

- name: Chrome Driver Permission Denied 対応
run: |
sudo chmod +x ./vendor/laravel/dusk/bin/chromedriver-linux64/chromedriver
sudo chmod +x ./vendor/laravel/dusk/bin/chromedriver-linux
# - name: Chrome Driver Permission Denied 対応
# run: |
# sudo chmod +x ./vendor/laravel/dusk/bin/chromedriver-linux64/chromedriver
# sudo chmod +x ./vendor/laravel/dusk/bin/chromedriver-linux

# https://stackoverflow.com/questions/76980975/chrome-driver-failing-in-laravel-dusk-failed-to-open-stream-http-request-fai
# https://voicetechno-jp.secure-web.jp/ChromeDriverV115orNewer.html
Expand All @@ -168,9 +170,9 @@ jobs:
# - 事前準備用の実行
# ---------------------------------------------

- name: 'Run Dusk データ準備用 - ログ管理 - マニュアルなし'
- name: 'Run Dusk データ準備用 - ログ管理'
if: always()
run: php artisan dusk tests/Browser/Manage/LogManageTest.php no_manual
run: php artisan dusk tests/Browser/Manage/LogManageTest.php

# ---------------------------------------------
# - 設計 ①
Expand Down Expand Up @@ -338,7 +340,7 @@ jobs:

- name: 'Run Dusk スライドショー'
if: always()
run: php artisan dusk tests/Browser/User/SlideshowsPluginTest.php no_api_test
run: php artisan dusk tests/Browser/User/SlideshowsPluginTest.php

- name: 'Run Dusk 開館カレンダー'
if: always()
Expand Down
36 changes: 20 additions & 16 deletions .github/workflows/laravel_dusk_connect-cms-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ on:
description: 'テストするPHPバージョン'
required: true
options:
- '8.0'
- '8.1'
- '8.2'
default: '8.0'
- '8.3'
default: '8.1'
# is_output_manual:
# type: boolean
# description: 'マニュアル出力'
# default: 'false'
env:
# schedule用
PHP_VERSION_DEFAULT: '8.0'
PHP_VERSION_DEFAULT: '8.1'
# IS_OUTPUT_MANUAL_DEFAULT: 'false'

jobs:
Expand Down Expand Up @@ -50,6 +50,10 @@ jobs:
sed -i -e 's|PDF_THUMBNAIL_API_URL=""|PDF_THUMBNAIL_API_URL="http://localhost:8000"|g' .env
sed -i -e 's|FACE_AI_API_URL=""|FACE_AI_API_URL="http://localhost:8000"|g' .env
# sed -e "$ a MANUAL_PUT_BASE=\"$GITHUB_WORKSPACE/tests/Manual/html/\"" .env
# マニュアル出力しない
sed -i -e 's|#DUSK_NO_MANUAL_ALL=true|DUSK_NO_MANUAL_ALL=true|g' .env
# APIテストを実行しない
sed -i -e 's|#DUSK_NO_API_TEST_ALL=true|DUSK_NO_API_TEST_ALL=true|g' .env

# schedule でphpバージョン指定
- name: Set if input php_version is empty
Expand Down Expand Up @@ -132,21 +136,21 @@ jobs:
- name: Chrome Version
run: /opt/google/chrome/chrome --version

# https://readouble.com/laravel/9.x/ja/dusk.html#managing-chromedriver-installations
# https://readouble.com/laravel/9.x/ja/dusk.html#running-tests-on-github-actions
# https://readouble.com/laravel/10.x/ja/dusk.html#managing-chromedriver-installations
# https://readouble.com/laravel/10.x/ja/dusk.html#running-tests-on-github-actions
# Chrome Version と Chrome Driverを同じにする
- name: Upgrade Chrome Driver
# run: php artisan dusk:chrome-driver --detect
run: php artisan dusk:chrome-driver --detect
# run: php artisan dusk:chrome-driver `/opt/google/chrome/chrome --version | cut -d " " -f3 | cut -d "." -f1`
run: php artisan dusk:chrome-driver `/opt/google/chrome/chrome --version | cut -d " " -f3`
# run: php artisan dusk:chrome-driver `/opt/google/chrome/chrome --version | cut -d " " -f3`

- name: Chrome Driver Copy
run: sudo \cp -f ./vendor/laravel/dusk/bin/chromedriver-linux64/chromedriver ./vendor/laravel/dusk/bin/chromedriver-linux
# - name: Chrome Driver Copy
# run: sudo \cp -f ./vendor/laravel/dusk/bin/chromedriver-linux64/chromedriver ./vendor/laravel/dusk/bin/chromedriver-linux

- name: Chrome Driver Permission Denied 対応
run: |
sudo chmod +x ./vendor/laravel/dusk/bin/chromedriver-linux64/chromedriver
sudo chmod +x ./vendor/laravel/dusk/bin/chromedriver-linux
# - name: Chrome Driver Permission Denied 対応
# run: |
# sudo chmod +x ./vendor/laravel/dusk/bin/chromedriver-linux64/chromedriver
# sudo chmod +x ./vendor/laravel/dusk/bin/chromedriver-linux

# https://stackoverflow.com/questions/76980975/chrome-driver-failing-in-laravel-dusk-failed-to-open-stream-http-request-fai
# https://voicetechno-jp.secure-web.jp/ChromeDriverV115orNewer.html
Expand All @@ -173,9 +177,9 @@ jobs:
# - 事前準備用の実行
# ---------------------------------------------

- name: 'Run Dusk データ準備用 - ログ管理 - マニュアルなし'
- name: 'Run Dusk データ準備用 - ログ管理'
if: always()
run: php artisan dusk tests/Browser/Manage/LogManageTest.php no_manual
run: php artisan dusk tests/Browser/Manage/LogManageTest.php

# ---------------------------------------------
# - 設計 ①
Expand Down Expand Up @@ -343,7 +347,7 @@ jobs:

- name: 'Run Dusk スライドショー'
if: always()
run: php artisan dusk tests/Browser/User/SlideshowsPluginTest.php no_api_test
run: php artisan dusk tests/Browser/User/SlideshowsPluginTest.php

- name: 'Run Dusk 開館カレンダー'
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
workflow_dispatch:

env:
PHP_VERSION: '8.0'
PHP_VERSION: '8.1'

jobs:
phpcs:
Expand Down
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/.phpunit.cache
/node_modules
/public/debug
/public/build
/public/hot
/public/storage
/public/themes/Users/*
Expand All @@ -11,16 +13,22 @@
/vendor
.env
.env.backup
.env.production
.env.testing
.env.dusk.*
.phpunit.result.cache
Homestead.json
Homestead.yaml
Homestead.json
Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
/.fleet
/.idea
/.vscode
!.gitkeep
/connect-cms.code-workspace
.vscode/
composer.phar
migration_config.ini
migration_config_nc3.ini
Expand Down
9 changes: 2 additions & 7 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')
// ->hourly();
Expand Down Expand Up @@ -52,10 +49,8 @@ protected function schedule(Schedule $schedule)

/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
protected function commands(): void
{
$this->load(__DIR__.'/Commands');
$this->load(__DIR__.'/CommandsOption');
Expand Down
14 changes: 2 additions & 12 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@

class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
];

/**
* A list of the inputs that are never flashed for validation exceptions.
*
Expand Down Expand Up @@ -86,10 +77,9 @@ public function render($request, Throwable $exception)
/**
* Register the exception handling callbacks for the application.
*
* @return void
* @link https://readouble.com/laravel/8.x/ja/errors.html#rendering-exceptions
* @link https://readouble.com/laravel/10.x/ja/errors.html#rendering-exceptions
*/
public function register()
public function register(): void
{
$this->renderable(function (\Swift_TransportException $e, $request) {
// メール設定エラー
Expand Down
Loading