Support the ongoing development of Laravel.io →
posted 2 years ago
Eloquent
Last updated 1 year ago.
0

Hey!

Is this all inside one table? Could you possibly share your database table structure (CREATE TABLE statement) and your model?

0

$date = Carbon::now()->subDays(7);

    $datas= ModelName::where('columnname1', '>=', $date)->orWhere('columnname2','>=', $date)->get();

    dd($datas);
0

@anilkumarthakur60 this won't return the date with value null if there's no data. It will only select the items that are in the last 7 days and return them if there are any.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

nordine enn nordinenn Joined 29 Oct 2021

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.