LoginSignup
0
1

More than 5 years have passed since last update.

Laravelで未来 or 過去のレコードの取得方法

Posted at

やりたいこと

期限を設定出来る機能を実装し、limited_atというカラムに未来の日付を登録していたとします。
やりたいこととしては、limited_atが現在よりも未来に設定しているレコードだけを取得する。

$items = Item::where('limited_at', '>', date('Y-m-d H:i:s'))->get();

で取得が出来ます。

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