1
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 ミドルウェアの仕組み

Posted at

ミドルウェアとは

HTTPリクエスト、又はレスポンスをチェックする機能
middlewareは自分で関数を定義して作成することができる。

主に使う用途としては、
・指定した変数が条件を満たしているか?
・認証されてるユーザーか?など

ミドルウェアの流れ

・ミドルウェアがない場合

 HTTPリクエス → Route → Controller → View → Response

・ミドルウェアを入れた場合
Before Middleware:リクエストをチェックする機能
After Middleware:レスポンスをチェックする機能

 HTTPリクエス → Route → Before Middleware → Controller → View → After Middleware → Response

参考記事

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