I\'m trying to get all records that belongs to last month, so far I managed to get all from last month but to date today, I\'m not sure how I can get only for last month
UPDATED eloquent version of the your answer
$fromDate = Carbon::now()->subMonth()->startOfMonth()->toDateString(); $tillDate = Carbon::now()->subMonth()->endOfMonth()->toDateString(); $revenueLastMonth = Callback::whereBetween('created_at',[$fromDate,$tillDate])->get();