close

[Solved] Laravel eloquent where date is equal or greater than DateTime

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Laravel eloquent where date is equal or greater than DateTime in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Laravel eloquent where date is equal or greater than DateTime Error Occurs?

Today I get the following error Laravel eloquent where date is equal or greater than DateTime in php.

How To Solve Laravel eloquent where date is equal or greater than DateTime Error ?

  1. How To Solve Laravel eloquent where date is equal or greater than DateTime Error ?

    To Solve Laravel eloquent where date is equal or greater than DateTime Error Here you can use this:
    ->where('date', '>=', date('Y-m-d'))

  2. To Solve Laravel eloquent where date is equal or greater than DateTime Error

    To Solve Laravel eloquent where date is equal or greater than DateTime Error Here you can use this:
    ->where('date', '>=', date('Y-m-d'))

Solution 1

Sounds like you need to use >=, for example:

->whereDate('date', '>=', Carbon::now('Europe/Stockholm'))

Solution 2

Here you can use this:

->where('date', '>=', date('Y-m-d'))

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment