Hey!
Is this all inside one table? Could you possibly share your database table structure (CREATE TABLE
statement) and your model?
$date = Carbon::now()->subDays(7);
$datas= ModelName::where('columnname1', '>=', $date)->orWhere('columnname2','>=', $date)->get();
dd($datas);
@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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community