Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

やりたいこと

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

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

で取得が出来ます。

sayama0402
Javascript(Riot.js / Vue / React / Nodejs) / PHP(Wordpress, cakePHP, Laravel) / Ruby(Ruby on Rails) / Python(Django) / SQL / Linux / Swift / Docker / AWS / Serverless
http://ken-sayama.hateblo.jp/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away