Good to give a sample of your date but it's difficult to understand your code.
You should have 3 parts, the controller, the view and the route that links both.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a lot of data. I want to bring the data from the database as a monthly wise. I have already used group by method but when I want to view the data all the data is showing but I want to see the specific month data. Below are my codes. Please help me.
public function RentCertificate(){
$data['fiscal_year'] = FiscalYear::all();
$data['month'] = Month::all();
$data['report'] = Report::status(1)->desk(15)->distric()->rentcertificate()->groupBy('month')->get();
$data['upazila'] = Upazila::all();
$data['upazilaoffice'] = UpazilaOffice::all();
$data['user'] = User::all();
$data['districoffice'] = DistricOffice::all();
return view('adcr.report.rent_certificate', $data);
}
This is my view code
@foreach($report as $full_info)
<tr>
<td style="text-align: center; border: 1px solid #000000; width: 2%" class="">{{$full_info->column_one}}</td>
<td style="text-align: center; border: 1px solid #000000; width: 2%" class="">{{$full_info->column_two}}</td>
<td style="text-align: center; border: 1px solid #000000; width: 2%" class="">{{$full_info->column_three}}</td>
<td style="text-align: center; border: 1px solid #000000; width: 2%" class="">{{$full_info->column_four}}</td>
<td style="text-align: center; border: 1px solid #000000; width: 2%" class="">{{$full_info->column_five}}</td>
<td style="text-align: center; border: 1px solid #000000; width: 2%" class="">{{$full_info->column_six}}</td>
<td style="text-align: center; border: 1px solid #000000; width: 2%" class="">{{$full_info->column_seven}}</td>
<td style="text-align: center; border: 1px solid #000000; width: 2%" class="">{{$full_info->column_eight}}</td>
</tr>
@endforeach
My Database like
|column_one|column_two|column_three|column_four|column_five|month|
|1 |2 | 3 | 4 | 4 | January|
|4 |3 | 42 | 41 | 44 | January|
|2 |23 | 4 | 2 | 4 | February|
Please or to participate in this conversation.