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?

More than 1 year has passed since last update.

LaravelでtweetアプリのCRUDを作成

Posted at

MVC

目的:LaravelのMVCの処理の流れを抑える
以下にCRUDの実装に必要な処理をまとめました。

Read

  • routes/web.php(ルーティング)
  • app/Http/Controllers/Tweet/IndexController.php(一覧)
  • app/Models/Tweet.php(モデル)
  • resources/views/tweet/index.blade.php(一覧ページ)

表示する時

Create

  • app/Http/Controllers/Tweet/IndexController.php(一覧)
  • resources/views/tweet/index.blade.php(一覧ページ・登録フォーム)
  • routes/web.php(ルーティング)
  • app/Http/Requests/Tweet/CreateRequest.php(登録用バリデーション)
  • app/Http/Controllers/Tweet/CreateController.php(登録)
  • app/Models/Tweet.php(モデル)

登録する時

Update(編集画面表示)

  • app/Http/Controllers/Tweet/IndexController.php(一覧)
  • resources/views/tweet/index.blade.php(一覧ページ・登録フォーム・編集フォーム)
  • routes/web.php(ルーティング)
  • app/Http/Controllers/Tweet/Update/IndexController.php(個別一覧)
  • app/Models/Tweet.php(モデル)
  • resources/views/tweet/update.blade.php(個別編集ページ)

編集する時

Update(更新)

  • resources/views/tweet/update.blade.php(個別編集ページ)
  • routes/web.php(ルーティング)
  • app/Http/Requests/Tweet/UpdateRequest.php(編集用バリデーション)
  • app/Http/Controllers/Tweet/Update/PutController.php(編集)
  • app/Models/Tweet.php(モデル)

更新する時

Delete

  • app/Http/Controllers/Tweet/IndexController.php(一覧)
  • resources/views/tweet/index.blade.php(一覧ページ・登録フォーム・削除フォーム)
  • routes/web.php(ルーティング)
  • app/Http/Controllers/Tweet/DeleteController.php(削除)
  • app/Models/Tweet.php(モデル)

削除する時

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?