我如何获得Laravel下个月生日的结果?

问题描述 投票:0回答:2

我有此代码,但我不能仅查询今天的生日。如果需要此查询类型该怎么办?

我需要生日,与年份无关(仅日和月)。>>


    public function birth(Request $request)
{

$today = Carbon::now()->format('Y-m-d');


  $birthday = DB::table('customers')
                     ->select('id_user','first_name','last_name','birth_date','open_user_date')
                     ->where('birth_date',$today)
                     ->get();



      return view('reports/birth',compact('birthday','date','today','hbddate'));
  }

我有此代码,但我不能仅查询今天的生日。如果需要此查询类型该怎么办?我需要一个生日,与年份无关(仅日和月)。公共职能的诞生(Request ...

sql laravel
2个回答
1
投票

您可以使用此代码来使客户今天过生日。


0
投票

我检查了all possible where clauses。也许whereDay和whereMonth是您需要的那些。

© www.soinside.com 2019 - 2024. All rights reserved.