0
0

More than 1 year has passed since last update.

Laravelのnullチェック使い分け(随時更新)

Last updated at Posted at 2021-12-31

Request

以下がある。

  • isset()
  • is_null()
  • empty()

※PHPのネイティブメソッド
各メソッドの違いはこちら

ちなみに : Requestのnull挙動

  • そもそも対象のnameが存在しない時
    nullになる

  • nameは存在するが、valueが空の時
    これもnullになる

Collection

以下がある。

  • isEmpty()
  • isNotEmpty()

※Laravelのコレクションメソッド

参考文献

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