Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel created_at where date format

$topshiriqnoma = $connection->table('topshiriqnoma')->select('created_at')->whereBetween('created_at',
    [
        Carbon::createFromFormat('Y-m-d', $start_time)->startOfDay()->toDateTimeString(),
        Carbon::createFromFormat('Y-m-d', $end_time)->endOfDay()->toDateTimeString()
    ]
)->orderBy('created_at', 'ASC')->get()->groupBy(function ($query) {
    return Carbon::parse($query->created_at)->format('Y-m-d');
});
 
PREVIOUS NEXT
Tagged: #laravel #date #format
ADD COMMENT
Topic
Name
3+3 =