@@ -387,7 +387,7 @@ public function boot(): void
387
387
388
388
``` php
389
389
Route::get('/user/{id}', function (string $id) {
390
- // Only executed if {id} is numeric...
390
+ // {id}が数値の場合にのみ実行される
391
391
});
392
392
```
393
393
@@ -434,10 +434,10 @@ Route::get(
434
434
特定のルートに名前を割り当てたら、Laravelの` route ` および` redirect ` ヘルパ関数を使い、URLやリダイレクトを生成するときにルートの名前を使用できます。
435
435
436
436
``` php
437
- // Generating URLs...
437
+ // RLを生成
438
438
$url = route('profile');
439
439
440
- // Generating Redirects...
440
+ // リダイレクトの生成
441
441
return redirect()->route('profile');
442
442
443
443
return to_route('profile');
@@ -508,11 +508,11 @@ public function handle(Request $request, Closure $next): Response
508
508
``` php
509
509
Route::middleware(['first', 'second'])->group(function () {
510
510
Route::get('/', function () {
511
- // Uses first & second middleware...
511
+ // 1番目と2番目のミドルウェアを使用
512
512
});
513
513
514
514
Route::get('/user/profile', function () {
515
- // Uses first & second middleware...
515
+ // 1番目と2番目のミドルウェアを使用
516
516
});
517
517
});
518
518
```
@@ -555,7 +555,7 @@ Route::domain('{account}.example.com')->group(function () {
555
555
``` php
556
556
Route::prefix('admin')->group(function () {
557
557
Route::get('/users', function () {
558
- // Matches The " /admin/users" URL
558
+ // /admin/usersのURLに一致
559
559
});
560
560
});
561
561
```
@@ -568,7 +568,7 @@ Route::prefix('admin')->group(function () {
568
568
``` php
569
569
Route::name('admin.')->group(function () {
570
570
Route::get('/users', function () {
571
- // Route assigned name "admin.users"...
571
+ // ルートを "admin.users"と名付ける
572
572
})->name('users');
573
573
});
574
574
```
@@ -599,10 +599,10 @@ Route::get('/users/{user}', function (User $user) {
599
599
use App\Http\Controllers\UserController;
600
600
use App\Models\User;
601
601
602
- // Route definition...
602
+ // ルート定義
603
603
Route::get('/users/{user}', [UserController::class, 'show']);
604
604
605
- // Controller method definition...
605
+ // コントローラメソッドの定義
606
606
public function show(User $user)
607
607
{
608
608
return view('user.profile', ['user' => $user]);
@@ -639,7 +639,7 @@ Route::get('/posts/{post:slug}', function (Post $post) {
639
639
640
640
``` php
641
641
/**
642
- * Get the route key for the model.
642
+ * モデルのルートキーの取得
643
643
*/
644
644
public function getRouteKeyName(): string
645
645
{
@@ -793,7 +793,7 @@ public function boot(): void
793
793
794
794
``` php
795
795
/**
796
- * Retrieve the model for a bound value.
796
+ * 値と結合するモデルの取得
797
797
*
798
798
* @param mixed $value
799
799
* @param string|null $field
@@ -809,7 +809,7 @@ public function resolveRouteBinding($value, $field = null)
809
809
810
810
``` php
811
811
/**
812
- * Retrieve the child model for a bound value.
812
+ * 結合した値の子モデルを取得
813
813
*
814
814
* @param string $childType
815
815
* @param mixed $value
0 commit comments