Description
as below is our query to fetch reocrd of last month and now date so how to do this so dear you will check it i will fetch record of now a day and previous day of record
View Code
as below is our query to fetch reocrd of last month and now date so how to do this
Your code is messed up and you haven't added the code in the code section. Anyway I am answering you here how you can retrieve last month data in Laravel
~~~
$fromDate = Carbon::now()->subMonth()->startOfMonth()->toDateString();
$tillDate = Carbon::now()->subMonth()->endOfMonth()->toDateString();
$revenueLastMonth = Callback::whereBetween('created_at',[$fromDate,$tillDate])->get();
~~~
0 Likes 0 Comments