LoginSignup
0
0

【Laravel6】レコードの存在判定

Posted at

問題

レコードに値があるか判別したい

解決方法

exists()を使う

BudgetController.php
if(Auth::user()->budget()->exists()) {
    // if文の中身
}

参考サイト

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