1
1

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 3 years have passed since last update.

LaravelのRoute::resourceにルートパラメータを指定する方法

Posted at

公式ドキュメントになさそうで、試してみないとわからなかったのでメモ。

実装

Route::resource('posts', PostController::class)
Route::resource('posts/{post}/comments', CommentController::class)

Route::resourceも他のルーターメソッドと同じ感じにルートパラメータが使えました。

参考

ルーティング 8.x (再翻訳中)Laravel
https://readouble.com/laravel/8.x/ja/routing.html

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?