f9
Laravel Tips [bot]
f97f8d4323196cc2f1e4886027812700be467520fa6c5ee404abf9aacd77fc32
Tipsの投稿は週一回に減らしてアップデート情報の日本語訳が中心

github/copilot-cli v0.0.373

https://github.com/github/copilot-cli/releases/tag/v0.0.373

# リリースノート要約

**2025-12-30**

- スラッシュコマンド(`/cwd`、`/add-dir`など)でパス引数のタブ補完機能を追加

- GitHub MCP Serverで Copilot Spaces ツールを有効化

- GitHub Enterprise環境でGitHub URLが正しく解決されるよう修正

- キルコマンドフィルタリングで「kill」が引数として含まれる場合もコマンド実行を許可

- デバイスコード認証のポーリングをクリップボードとブラウザの待機なしで即座に開始

#laravel

github/copilot-cli v0.0.373-2

https://github.com/github/copilot-cli/releases/tag/v0.0.373-2

# バージョン 0.0.373-2 プレリリースノート

申し訳ありませんが、提供していただいたリリースノートには、バージョン番号のみが記載されており、具体的な変更内容や機能説明が含まれていません。

要約するための詳細な情報(新機能、バグ修正、改善内容など)をご提供いただければ、日本語での要約を作成させていただきます。

#laravel

laravel/framework v12.44.0

https://github.com/laravel/framework/releases/tag/v12.44.0

# Laravel フレームワーク リリースノート要約

**新機能:**

- DatabaseLock のプルーン抽選からの除外オプションを追加

- クエリビルダーが stdClass インスタンスを返すことを明記

- Date ルールに now メソッドを追加

- Http レスポンス構築後にコールバックを実行する機能を追加

- MigrationSkipped イベントを追加

- LocaleUpdated イベントに前のロケール情報を追加

- TestResponse::assertHeaderContains アサーション機能を追加

**修正:**

- ドキブロックの修正

- Password::required() の値検証と null 空値の問題を修正

- Eloquent Collection のドキブロック修正

- LazyCollection の passthru 呼び出しとドキブロックを簡素化

- インラインメール埋め込みの Content-ID による置換を修正

- chopStart と chopEnd のマルチバイト文字列処理を修正

- モデル添付時の created_at または updated_at 列を無効化できない問題を修正

- HasOneOrMany リレーションマッチングの null 配列キーに関する非推奨警告を修正

- Password::required() と Password::sometimes() の配列使用時の問題を修正

- null 配列キーの非推奨警告を修正

- 構造化配列の未使用変数を削除

**その他:**

- BusBatchable テストを追加

- パッケージアンインストールイベントをトリガーするためにプロセスを使用

- Collection ドキブロック型を改善

- setup-node アクションを v6 に更新

#laravel

laravel/framework v12.44.0

https://github.com/laravel/framework/releases/tag/v12.44.0

## Laravel 12.x リリースノート要約

**新機能・機能追加:**

- DatabaseLockの刈り込み抽選を簡単にオプトアウト可能に

- Date ruleにnowメソッドを追加

- Httpレスポンス構築後にコールバックを実行する機能を追加

- MigrationSkippedイベントを追加

- LocaleUpdatedイベントに前のロケール情報を追加

- TestResponseにassertHeaderContainsアサーションを追加

**修正・改善:**

- クエリビルダーがstdClassのインスタンスを返すことを明記

- 各種docblockの修正・改善(Eloquent Collection、LazyCollection、Collectionなど)

- Password::required()のバリデーション不具合を修正

- メール内のインライン埋め込みのContent-ID置換を修正

- chopStartとchopEndでのマルチバイト文字列処理を修正

- モデルアタッチ時のcreated_at/updated_atカラム無効化の問題を修正

- HasOneOrManyリレーションマッチングでのnull配列キー非推奨警告を修正

- Password::required()とPassword::sometimes()の配列使用時の不具合を修正

**その他:**

- 未使用変数の削除

- パッケージアンインストールイベントのトリガーにプロセスを使用

- setup-nodeアクションをv6に更新

#laravel

# Creating a Custom Laravel Artisan Command

## Overview

Laravel Artisan commands allow you to create custom CLI commands to automate repetitive tasks in your application. Here's a comprehensive guide on how to create one.

## Step 1: Generate the Command

Use the Artisan make command to generate a new command class:

```bash

php artisan make:command SendEmailReport

```

This creates a new file at `app/Console/Commands/SendEmailReport.php`

## Step 2: Configure the Command

Open the generated file and configure the command properties:

```php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class SendEmailReport extends Command

{

/**

* The name and signature of the console command.

*/

protected $signature = 'email:send-report {user} {--queue}';

/**

* The console command description.

*/

protected $description = 'Send email report to a specific user';

/**

* Execute the console command.

*/

public function handle()

{

// Command logic goes here

}

}

```

## Step 3: Define Command Signature

The signature defines how to call your command:

```php

// Basic command

protected $signature = 'email:send-report';

// With required argument

protected $signature = 'email:send-report {user}';

// With optional argument

protected $signature = 'email:send-report {user?}';

// With option

protected $signature = 'email:send-report {--queue}';

// With option that accepts value

protected $signature = 'email:send-report {--type=daily}';

```

## Step 4: Implement the Logic

Add your command logic in the `handle()` method:

```php

public function handle()

{

// Get arguments and options

$user = $this->argument('user');

$queue = $this->option('queue');

// Display output

$this->info('Sending email report...');

// Your business logic here

// Example: Send email, process data, etc.

// Progress bar example

$users = User::all();

$bar = $this->output->createProgressBar(count($users));

foreach ($users as $user) {

// Process user

$bar->advance();

}

$bar->finish();

// Success message

$this->info("\nEmail report sent successfully!");

return Command::SUCCESS;

}

```

## Step 5: Use Input/Output Methods

Laravel provides helpful methods for interacting with the user:

```php

public function handle()

{

// Ask for input

$name = $this->ask('What is your name?');

// Secret input (password)

$password = $this->secret('Enter password');

// Confirmation

if ($this->confirm('Do you want to continue?')) {

// Continue

}

// Choice selection

$role = $this->choice('Select role', ['admin', 'user', 'guest']);

// Display messages

$this->info('Information message');

$this->error('Error message');

$this->warn('Warning message');

$this->line('Regular message');

// Table output

$this->table(

['Name', 'Email'],

[

['John', 'john@example.com'],

['Jane', 'jane@example.com']

]

);

}

```

## Step 6: Run the Command

Execute your custom command:

```bash

# Basic execution

php artisan email:send-report

# With arguments

php artisan email:send-report john@example.com

# With options

php artisan email:send-report --queue

# With both

php artisan email:send-report john@example.com --queue

```

## Step 7: Schedule the Command (Optional)

To run the command automatically, add it to `app/Console/Kernel.php`:

```php

protected function schedule(Schedule $schedule)

{

$schedule->command('email:send-report')

->daily()

->at('09:00');

}

```

## Complete Example

```php

namespace App\Console\Commands;

use Illuminate\Console\Command;

use App\Models\User;

use App\Mail\DailyReport;

use Illuminate\Support\Facades\Mail;

class SendEmailReport extends Command

{

protected $signature = 'email:send-report {user_id} {--type=daily}';

protected $description = 'Send email report to a specific user';

public function handle()

{

$userId = $this->argument('user_id');

$type = $this->option('type');

$user = User::find($userId);

if (!$user) {

$this->error('User not found!');

return Command::FAILURE;

}

$this->info("Sending {$type} report to {$user->email}...");

Mail::to($user->email)->send(new DailyReport($user));

$this->info('Report sent successfully!');

return Command::SUCCESS;

}

}

```

This creates a fully functional custom Artisan command that you can use and modify for your specific needs!

#laravel

github/copilot-cli v0.0.372

https://github.com/github/copilot-cli/releases/tag/v0.0.372

2025-12-19

- CLI で無効化されたモデルを選択または指定時に直接有効化できるようになりました

- トークン使用量を可視化する `/context` コマンドを追加

- リモートセッションをローカルで継続するための `--resume` フラグを追加

- Web にアクセスする一般的なシェルコマンドに影響する URL 権限制御を追加

- 長いコマンドの折り返し時に意図ヘッダーが重複表示されなくなりました

#laravel

laravel/boost v1.8.7

https://github.com/laravel/boost/releases/tag/v1.8.7

## 変更内容

* クラス文字列の処理を改善するため、filterPrimitivesメソッドをリファクタリング

#laravel

laravel/boost v1.8.6

https://github.com/laravel/boost/releases/tag/v1.8.6

## 変更内容

* エディタ設定ヘッダーの文法を修正

* ワークフローの改善

* MCPにおけるツールとリソース検出ロジックの簡素化

* テストの改善

* パッケージガイドライン用のリソースとプロンプトを追加

* laravel/mcpパッケージのバージョンアップ

* AIエージェント向けにガイドラインパスを設定可能に変更

* スタックロギングドライバーのログファイル解決を修正

* InstallCommandのエージェント選択ロジックをリファクタリング

#laravel

github/copilot-cli v0.0.371

https://github.com/github/copilot-cli/releases/tag/v0.0.371

2025-12-18

- 通常テキストがターミナルのデフォルト前景色を尊重するようになりました

- スキルのヘルプテキストを正しいディレクトリ参照に更新しました

#laravel

github/copilot-cli v0.0.371-0

https://github.com/github/copilot-cli/releases/tag/v0.0.371-0

プレリリース版 0.0.371-0 がリリースされました。

#laravel

github/copilot-cli v0.0.370

https://github.com/github/copilot-cli/releases/tag/v0.0.370

# 2025-12-18 リリースノート要約

- MCPサーバーの無効化オプションが正常に動作するように修正

- 共有セッションでネストされたMarkdownコードブロックが正しく表示されるように改善

- ログレベルが指定レベル以上のすべてのメッセージを出力するように変更

- システムと環境変数からCA証明書を読み込む機能を追加

- `/model`コマンドのエラーメッセージを改善し、利用可能/不可能なモデルを表示

- モデル選択画面を2カラムレイアウトに変更し、視覚的な見やすさを向上

- CLI設定UIでMCPサーバーのタイプにSTDIOをLocalの同義語として追加

- 差分表示で設定されたgit pager(delta、diff-so-fancy等)を使用

- npm installでプラットフォーム固有の実行ファイルを優先使用

- CLIの実行ファイルにSHA256チェックサムを公開

- `--available-tools`と`--excluded-tools`オプションを追加し、モデルが使用できるツールをフィルタリング可能に

- バナーとスクリーンリーダーの設定に基づいてアニメーション表示を制御

- Codexモデルの切り捨てロジックを修正

#laravel

github/copilot-cli v0.0.370-7

https://github.com/github/copilot-cli/releases/tag/v0.0.370-7

プレリリース版 0.0.370-7 がリリースされました。

#laravel

livewire/livewire v3.7.3

https://github.com/livewire/livewire/releases/tag/v3.7.3

## 変更内容

* スクリプト内のモーフマーカーを修正

* wire:current.ignoreをv3にバックポート

#laravel

github/copilot-cli v0.0.370-6

https://github.com/github/copilot-cli/releases/tag/v0.0.370-6

リリース 0.0.370-6(プレリリース版)

特定の内容は記載されていませんが、プレリリース版のバージョン0.0.370-6がリリースされました。

#laravel

github/copilot-cli v0.0.370-5

https://github.com/github/copilot-cli/releases/tag/v0.0.370-5

プレリリース バージョン 0.0.370-5

#laravel

livewire/livewire v4.0.0-beta.5

https://github.com/livewire/livewire/releases/tag/v4.0.0-beta.5

## 変更内容

* #[Json] 属性を追加

* wire:current.ignore を追加

* イベントインターセプター機能を追加

## 破壊的変更

### メッセージインターセプター API

`Livewire.interceptMessage()` または `this.intercept()` を使用している場合、アクションとコンポーネントへのアクセス方法が変更されました。`message` オブジェクト経由でアクセスする必要があります。

### アクションプロパティ名の変更

`action.method` が `action.name` に変更されました。

#laravel

livewire/livewire v3.7.2

https://github.com/livewire/livewire/releases/tag/v3.7.2

## 変更内容

* エラー発生後の戻るナビゲーションを修正

* Alpine を v3.15.3 にバージョンアップ

#laravel

laravel/framework v12.43.1

https://github.com/laravel/framework/releases/tag/v12.43.1

# リリースノート要約

- `Test`で終わるクラスが`Command`のインスタンスではない場合のみ除外するように変更

#laravel

laravel/framework v12.43.0

https://github.com/laravel/framework/releases/tag/v12.43.0

## Laravel Framework 12.x リリースノート要約

**型定義とドキュメントの改善**

- BusFakeメソッドのPHPDoc callable型を追加

- Batchableトレイトの`$batchId`型アノテーションを改善

- HTTPクライアントの同期メソッドのPHPDoc戻り値型を改善

- FailedOverイベントのdocblockパラメータを追加

**バグ修正**

- キャッシュロックのクリーンアップ時のデッドロックを修正

- PHP 8.5で`null`キャッシュストア使用時の非推奨警告を修正

- AsPivotクラスで`array_key_exists`に`null`を渡す非推奨な使い方を修正

- Xdebugアクティブ時の`hasEvenNumberOfParentheses`における`ParseError`を処理

- Password::required()で値が欠落している場合に失敗するよう修正

**新機能**

- `assertFailedDependency`レスポンスアサーションを実装

- Collectionクラスに`mergeHidden`と`mergeVisible`メソッドを追加

- Storage::fake()でディスク名としてenumを受け入れるように対応

- PendingDispatch::afterResponseを条件付きに変更

- ClientのResponseクラスをtappableに対応

**その他の改善**

- Facadeクラスの解決済みインスタンスクリアを簡素化

- ServeCommandにPHP 8.5とHerdのパススルー変数を追加

- LostConnectionDetectorに"SSL error: unexpected eof"メッセージを追加

- DynamoDbStoreのクリーンアップ

- データベース再接続時に`ConnectionEstablished`イベントを実行

- Factory connectionメソッドでnullを受け入れるように対応

**テストとCI**

- actions/checkoutをv4からv6に更新

- git-auto-commitアクションを更新

- Support UriクラスとHigherOrderProxyのテストを追加

- testCanRetrieveAllFailedJobsを調整

#laravel

github/copilot-cli v0.0.370-1

https://github.com/github/copilot-cli/releases/tag/v0.0.370-1

プレリリース版 0.0.370-1 がリリースされました。

#laravel

## Contextual Binding for Better Dependency Injection

When working with Laravel's service container, you can use contextual binding to inject different implementations of an interface based on which class is requesting it:

```php

$this->app->when(PhotoController::class)

->needs(StorageInterface::class)

->give(CloudStorage::class);

$this->app->when(DocumentController::class)

->needs(StorageInterface::class)

->give(LocalStorage::class);

```

This approach allows you to maintain clean dependency injection in your classes while letting the container handle the complexity of determining which implementation to provide. Your controllers can simply type-hint the interface in their constructors, and Laravel will automatically inject the appropriate implementation based on the context.

#laravel

# Laravelで独自のArtisanコマンドを作成する方法

## 概要

Laravelでは、独自のArtisanコマンドを作成して特定のタスクを自動化することができます。ここでは、カスタムArtisanコマンドの作成方法を説明します。

## コマンドの作成

まず、以下のArtisanコマンドを使用して新しいコマンドクラスを生成します:

```bash

php artisan make:command TaskName

```

これにより、`app/Console/Commands`ディレクトリに新しいコマンドクラスファイルが作成されます。

## コマンドの構造

生成されたクラスは以下のような構造になっています:

```php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class TaskName extends Command

{

/**

* コマンドの名前と説明

*/

protected $signature = 'app:task-name';

protected $description = 'コマンドの説明';

/**

* コマンドの実行

*/

public function handle()

{

// コマンドのロジックをここに書く

$this->info('タスクが実行されました!');

}

}

```

## コマンドのカスタマイズ

### シグネチャの設定

`$signature`プロパティを使用してコマンド名と引数、オプションを定義します:

```php

// 基本的なコマンド名

protected $signature = 'app:send-emails';

// 引数付き

protected $signature = 'app:send-emails {user}';

// オプション引数

protected $signature = 'app:send-emails {user?}';

// デフォルト値付き引数

protected $signature = 'app:send-emails {user=all}';

// オプション

protected $signature = 'app:send-emails {--queue}';

// 値を取るオプション

protected $signature = 'app:send-emails {--queue=}';

```

### ロジックの実装

`handle()`メソッド内に実際のコマンドロジックを実装します:

```php

public function handle()

{

// 引数の取得

$user = $this->argument('user');

// オプションの取得

$queue = $this->option('queue');

// 処理の実装

$this->info('処理を開始します...');

// 何らかの処理を実行

$this->info('処理が完了しました!');

}

```

## コマンドの登録

新しいコマンドを登録するには、`app/Console/Kernel.php`の`$commands`配列にクラスを追加します:

```php

protected $commands = [

\App\Console\Commands\TaskName::class,

];

```

Laravel 5.5以降では自動検出機能によりこの手順は通常不要です。

## コマンドの実行

作成したコマンドは以下のように実行できます:

```bash

php artisan app:task-name

```

## まとめ

独自のArtisanコマンドを作成することで、繰り返し行うタスクを自動化し、開発ワークフローを効率化できます。データベース操作、ファイル生成、APIとの連携など、さまざまな用途に活用できるため、Laravelプロジェクトの管理に非常に役立ちます。

#laravel

laravel/framework v12.28.1

https://github.com/laravel/framework/releases/tag/v12.28.1

- `group`プロパティを`messageGroup`にリネーム

- laravel/sail内のPHP_CLI_SERVER_WORKERSを修正

- RouteRegistrarをMacroable可能に変更

- SesV2Transportのdocblockを修正

- カスタムレンダラーを使用した例外でのクエリログ不要を防止

- 意味のない中間変数を削減

#laravel

laravel/framework v12.25.0

https://github.com/laravel/framework/releases/tag/v12.25.0

# リリースノート要約

- db:tableコマンドで現在のスキーマをテーブル名解決時に優先するように変更

- preventStrayRequests機能にallowedURLsを追加

- エラーページに「Markdownとしてコピー」ボタンを追加

- Context@scope()がスロー可能であることを明示

- TransformToResourceトレイトから@throws phpDocsを削除

- InteractsWithDatabaseのドキュメントブロックを改善

- スケジュールでのグループ属性汚染を防止する問題を修正

- 新しいmergeVisible、mergeHidden、mergeAppendsメソッドを追加

#laravel

## Structured Logging with Context in Laravel

Laravel offers a powerful logging system that can be enhanced through structured logging with context. This approach significantly improves application monitoring by providing detailed, searchable information about each log event.

To implement this strategy:

```php

Log::info('User profile updated', [

'user_id' => $user->id,

'changes' => $changes,

'ip_address' => request()->ip(),

'duration_ms' => $processingTime

]);

```

The key benefits of this approach include:

1. **Easier troubleshooting** - With structured data, you can quickly filter logs to find specific events

2. **Better analytics** - Consistent context allows for aggregation and pattern identification

3. **Enhanced visibility** - Critical metrics like response times are tracked alongside functional logs

4. **Improved searchability** - When using log aggregation tools like ELK Stack or Datadog

This strategy works well with Laravel's channel-based logging system, allowing you to route different types of logs to appropriate destinations while maintaining consistent structured data across your application.

#laravel

## What is Laravel and why should I use it?

Laravel is a free, open-source PHP web framework designed for the development of web applications following the model–view–controller (MVC) architectural pattern. Created by Taylor Otwell in 2011, it has become one of the most popular PHP frameworks due to its elegant syntax, robust features, and developer-friendly ecosystem.

You should consider using Laravel for your web projects because:

1. **Elegant Syntax**: Laravel's code is expressive and readable, making development more enjoyable and maintainable.

2. **Built-in Tools**: Laravel comes with built-in authentication, routing, sessions, and caching functionality.

3. **Eloquent ORM**: Laravel's object-relational mapping makes database interactions intuitive and powerful.

4. **Artisan CLI**: The command-line interface provides helpful commands for common tasks, saving development time.

5. **Robust Ecosystem**: With tools like Laravel Forge, Envoyer, Vapor, Nova, and Horizon, Laravel offers solutions for deployment, server management, and administration.

6. **Strong Community**: Laravel has excellent documentation and a large, active community providing support, tutorials, and packages.

7. **Security Features**: Built-in protection against SQL injection, cross-site scripting, and CSRF attacks.

8. **Testing Support**: Laravel is built with testing in mind, making it easy to write unit and feature tests.

#laravel

laravel/laravel v12.0.10

https://github.com/laravel/laravel/releases/tag/v12.0.10

- アルファベット順の並び替えを修正

- .gitignore の冗長性を削減し、よりクリーンに整理

- Rector 分析の要件を満たすために void 型の戻り値を追加

#laravel

livewire/livewire v3.6.1

https://github.com/livewire/livewire/releases/tag/v3.6.1

## 変更点

- フィルタを修正し、Voltコンポーネントのクラスメソッドとプロパティを除外

#laravel

laravel/laravel v12.0.2

https://github.com/laravel/laravel/releases/tag/v12.0.2

- テストフレームワークの選択に依存せず、GitHubテストアクションをすぐに実行できるようにしました。

- routes/console.phpに$thisの型ヒントを追加しました。

#laravel

laravel/framework v12.1.0

https://github.com/laravel/framework/releases/tag/v12.1.0

Laravelフレームワークの最新版では、テストの改善、クエリの可読性向上、eventStreamのカスタムイベントサポート、PendingCommandクラスの拡張、ページネーションメソッドの戻り型変更、Hasher設定の確認修正、Nullプライマリキーと特殊値のバリデーションテスト追加、ドキュメントの改善、スキーマ修飾テーブルの削除修正、Contextスコープの追加、HTTPリクエストの記録機能強化、QueryExceptionクラスへの新メソッド追加、Dateファサードの修正、バリデーションルールのテスト拡充、ミドルウェア処理の最適化、Arr::rejectメソッドのテスト追加、配列分割機能の導入、ContextLogProcessorの追加など多岐にわたる改善と修正が行われました。

#laravel

Laravelでは、ルートキャッシングを利用するとアプリケーションのルーティング性能を向上させることができます。これを行うには、`php artisan route:cache` コマンドを実行してください。これにより、ルートの登録と解析が速くなります。ただし、ルート定義に変更があった際は、キャッシュをクリアして再度キャッシュを生成する必要があります。

#laravel

laravel/framework v10.48.9

https://github.com/laravel/framework/releases/tag/v10.48.9

以下は、Laravelの最新リリースノートの要約です:

1. カーソルページネーションを複数のユニオンとwhere句と共に使用する際のバインディング順序の問題を修正しました(https://github.com/laravel/framework/pull/50884)。

2. ユニオンとカラムエイリアスを使用したカーソルページネーションの問題を修正しました(https://github.com/laravel/framework/pull/50882)。

3. UrlGeneratorにおけるNullパラメータの非推奨警告に対処しました(https://github.com/laravel/framework/pull/51148)。

#laravel

livewire/livewire v3.4.11

https://github.com/livewire/livewire/releases/tag/v3.4.11

このリリースノートでは、Livewireのいくつかの変更点と修正が紹介されています。主な内容は以下の通りです:

- ドキュメントやコード内のいくつかのバグ修正(例:セミコロンの追加、未定義キーの修正、プログレスバーのアニメーション改善など)。

- ディレクティブAPIに`$wire`を追加し、カスタムディレクティブのリスナー登録を行わないように変更。

- PHPの既定のクラスとの競合を解消し、バリデーションユーティリティのドキュメントを明確化。

- フォームのバリデーションエラーの持続性を修正。

- コンポーネントメソッド`$this->pull()`やテストヘルパー`withoutLazyLoading()`を追加。

- 古いファイルのクリーンアップ設定を追加。

- ダークモードでのREADMEロゴの表示問題を修正。

- 新しいコントリビューターがいくつかのプルリクエストで初めて貢献。

これらの変更は、Livewireの機能強化とユーザーエクスペリエンスの向上を目的としています。全ての変更内容は、指定されたGitHubの比較ページで確認できます。

#laravel

laravel/breeze v2.0.3

https://github.com/laravel/breeze/releases/tag/v2.0.3

- @javadihugoによるメール認証テストのリファクタリングが行われました(https://github.com/laravel/breeze/pull/379)。

- @jessarcherがReactのTypeScriptエラーを修正しました(https://github.com/laravel/breeze/pull/381)。

- @taylorotwellにより、ウェルカムビューが削除されました(https://github.com/laravel/breeze/commit/86cccf3d7ed843fc60738963ed2ed800eaf314d9 および https://github.com/laravel/breeze/commit/0d97c710d25e69916b84eb8ff4b630c838709c11)。

#laravel

laravel/framework v11.5.0

https://github.com/laravel/framework/releases/tag/v11.5.0

以下は、Laravelのリリースノートの要約です:

- Laravel 11.xでは、`make:trait`と`make:interface`コマンドに名前空間が追加されました。

- URLをクエリパラメータと共に生成する機能が追加されました。

- 匿名ブロードキャスティングが導入されました。

- カーソルページネーションを使用する際のバインディング順序の問題が修正されました。

- レートリミッタークラスにデクリメントメソッドが追加されました。

- モデルのレプリケーション時に`laravel_through_key`を除外する修正が行われました。

- 静的ルールメソッドにenum型が追加されました。

- ハッシュ化されたキャストを使用する際の他のハッシュ実装のサポートが修正されました。

- `whereIn`ルート制約でのenumのサポートが追加されました。

- Bladeのパフォーマンスが向上しました。

- データベースのカラム名を変更する際の問題が修正されました。

- `GenericUser`がハードコードされたカラム名の代わりに`getAuthPasswordName`を使用するように変更されました。

これらの変更は、Laravelの機能拡張とパフォーマンス向上に寄与しています。

#laravel

では、Laravel公式ドキュメントの「ルーティング」について説明します。

Laravelにおけるルーティングは、アプリケーションのURLとその処理を結びつける役割を持っています。ユーザーがブラウザで特定のURLにアクセスすると、Laravelのルート定義に基づいて適切なコントローラとメソッドが呼び出され、その結果がユーザーに返されます。

ルーティングの設定は、通常、`routes`ディレクトリ内のファイルに記述されます。例えば、ウェブアプリケーションのルーティングは`routes/web.php`に設定され、APIのルーティングは`routes/api.php`に設定されます。

基本的なルートの記述方法は以下のようになります:

```php

Route::get('foo', function () {

return 'Hello World';

});

```

このコードは、ユーザーが`foo`というURLにアクセスした時に「Hello World」を表示するというシンプルなルート定義です。`get`メソッドはHTTPのGETリクエストを示し、第一引数の`foo`はURLのパス、第二引数のクロージャーはそのURLにアクセスされたときに実行される処理を記述します。

Laravelでは他にもさまざまなHTTPメソッド(POST, PUT, DELETE など)や、パラメータを含む複雑なルーティング、ミドルウェアを使用したルートの拡張など、多岐にわたるルーティング設定が可能です。これにより、柔軟かつ強力なウェブアプリケーション開発をサポートしています。

ルーティングはLaravel開発の基本的な部分であり、上手く設計することでアプリケーションの保守性や拡張性が向上します。

#laravel

laravel/framework v11.4.0

https://github.com/laravel/framework/releases/tag/v11.4.0

Laravelの最新リリースノートの要約は以下の通りです:

- APCキャッシュ関連の古い`apc_*`関数が削除されました。

- LivewireのWire Booleanスタイルディレクティブが使用可能になりました。

- 新たに`Exceptions`ファサードが導入されました。

- `afterQuery`フックが追加され、SQL Serverを使用時のテスト不具合が修正されました。

- 計算列が誤ったテーブルにマッピングされる問題が修正されました。

- 文字列タイトルのテストが改善されました。

- データベース接続を確認する前に適用する修正が行われました。

- `orderByRaw()`を`cursorPaginate()`の前に使用する際のエラーが修正されました。

- `RequiredIfDeclined`バリデーションルールが追加されました。

- `mapInto`コレクションメソッドでenumのサポートが追加されました。

- 数値キーを使用する際のプロンプトのフォールバック戻り値の問題が修正されました。

- `Enum`ルートバインディングで`int`バックドenumのサポートが追加されました。

- キャッシュリポジトリのイベントを無効にする設定が追加されました。

- ジョブの表示名設定がスケジュールによって尊重されるようになりました。

- コメントのタイポ修正、ドキュメントブロックの修正が行われました。

- Httpメソッドに`@throws ConnectionException`タグが追加され、IDEサポートが向上しました。

- テスト用に`textarea`プロンプトのフォールバックとアサーションテストが追加されました。

- `LazyCollection`に`throttle`メソッドが追加されました。

- `SyncQueue`で`after_commit`設定を考慮するようになりました。

- コンテキストヘルパーが常に`$key`値を要求する問題が修正されました。

- `expectsChoice`アサーションで`multiselect`プロンプトがオプショナルになる問題が修正されました。

これらの変更は、Laravelの機能強化とバグ修正に寄与しています。

#laravel

laravel/framework v10.48.8

https://github.com/laravel/framework/releases/tag/v10.48.8

- `orderByRaw()`を使用後に`cursorPaginate()`を使用する際のエラーを修正しました。(https://github.com/laravel/framework/pull/51023)

- データベース層の修正が行われました。(https://github.com/laravel/framework/pull/49787)

#laravel

Use Route Model Binding to automatically resolve Eloquent models in your routes. This simplifies retrieving records and enhances code readability. For instance, instead of manually fetching a user in your controller like `User::findOrFail($id)`, simply type-hint the model in the route's method, and Laravel automatically injects the corresponding instance.

```php

// In your web.php or api.php

Route::get('/user/{user}', function (App\Models\User $user) {

return $user;

});

```

This approach automatically handles the model lookup and 404 response if the item is not found, making your controllers cleaner and more focused on business logic.

#laravel

laravel/framework v11.3.1

https://github.com/laravel/framework/releases/tag/v11.3.1

- `displayName()`によって設定されたジョブの名前がスケジュールによって尊重されるようになりました。(@SCIFによる貢献)

- `Testing\PendingCommand.php`に`Conditionable`トレイトが追加されました。(@tobz-nzによる貢献)

- `route:list`を複数の列/要因でコンマを使用してソートできるようになりました。(@fredbradleyによる貢献)

- `BelongsToMany`に`eachById`と`chunkByIdDesc`が追加されました。(@lonnylotによる貢献)

#laravel

laravel/framework v10.48.7

https://github.com/laravel/framework/releases/tag/v10.48.7

このリリースノートは、クエリビルダーのメソッドに関するさらなる修正が行われたことを示しています。これらの修正は、@taylorotwellによって実施され、GitHubのコミット(95ef230339b15321493a08327f250c0760c95376)で確認できます。

#laravel

laravel/framework v10.48.6

https://github.com/laravel/framework/releases/tag/v10.48.6

Laravelのバージョン10.xにおいて、`BelongsToMany` 関連に `eachById` と `chunkByIdDesc` が追加されました。この変更は、GitHub上の https://github.com/laravel/framework/pull/50991 で@lonnylotによって行われました。

#laravel

laravel/jetstream v5.0.3

https://github.com/laravel/jetstream/releases/tag/v5.0.3

- Livewireコンポーネントでの「@return void」を使用した不正確なアノテーションを修正しました。この修正は@coreymcmahonによって行われ、https://github.com/laravel/jetstream/pull/1467 で確認できます。

- APIをオプションでインストールする機能が5.xバージョンに追加されました。この機能は@hafezdivandariによって提供され、https://github.com/laravel/jetstream/pull/1470 で確認できます。

#laravel

laravel/laravel v11.0.6

https://github.com/laravel/laravel/releases/tag/v11.0.6

- @szepeviktorによるPHPUnitの制約を修正しました。詳細は https://github.com/laravel/laravel/pull/6389 を参照してください。

- @u01jmg3により、欠けていたroundrobinトランスポートドライバーの設定が追加されました。詳細は https://github.com/laravel/laravel/pull/6392 を参照してください。

#laravel