Order by for a Day on whereMonth for Eloquent Laravel 5.7?

后端 未结 1 1593
礼貌的吻别
礼貌的吻别 2021-01-29 02:40

Error to order by for a day on month.

this my query

$birthday = \\App\\Admin\\Clients::whereMonth(\'birthday\', \\Carbon\\Ca         


        
相关标签:
1条回答
  • 2021-01-29 03:10

    You could try:

    $birthday = \App\Admin\Clients::whereMonth('birthday', \Carbon\Carbon::now()->month)
                ->orderByRaw('day(birthday) asc')->get();
    
    0 讨论(0)
提交回复
热议问题