user15568390
user15568390

Reputation:

Laravel Carbon usage

I have a query.So when i try get data from database,it show me null.

$heading = DB::table('heading')->where('heading.post_date',Carbon::today())->first();
     

Upvotes: 0

Views: 295

Answers (1)

Alexander Rubia
Alexander Rubia

Reputation: 66

Can you try with "whereDate" method ?

For example:

$heading = DB::table('heading')->whereDate('heading.post_date', Carbon::today())->first();

You can find more documentation here: https://laravel.com/docs/8.x/queries

Upvotes: 1

Related Questions