Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

get record of last 24 hours in laravel

Method # 1
 Mood::where('created_at', '>=', Carbon::now()->subDay())->get();

Method # 2
 Mood::whereBetween('created_at', [now()->subMinutes(1440), now()])->get();
Source by laracasts.com #
 
PREVIOUS NEXT
Tagged: #record #hours #laravel
ADD COMMENT
Topic
Name
9+2 =