I have a column in my table called date
which is of type TIMESTAMP
.
I am trying to add a very simply scope which will return all results that have a date of tomorrow.
I think I want to be able to do something like this:
public function scopeTomorrow($query)
{
return $query->where('date', function ($date) {
return \Carbon\Carbon::parse($date)->isTomorrow();
});
}
But the $date
variable is currently just the query builder.
How can I create a where
statement which accepts the value and perfroms some sort of check on it?