0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Route:resourceの正しい理解

Last updated at Posted at 2024-01-04

気になったこと

・Route:resourceの仕組み

(Routes/XXX.php配下)

Route::resource('xxx', XXXController::class)
    ->except(['show']);

理解したこと

・create/upudateなどのアクションのRouteを1行で纏められる
(参照項目:リソースコントローラにより処理されるアクション)
・exceptで不要なルーティングは割愛出来る

メリット

・アクションごとにルーティング記載が不要で手間が省ける

感想

・これだけでもコード数が軽減されすごく楽になる

次回アクション

・理解が正しいかの確認

参考(公式)サイト

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?