Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MissBeginner's avatar

How to get data on the same date Ex: Start Date: 7/6/2023 End Date: 7/6/2023

Hello, I am beginner. I need help on how to get the data on the same date. I have to to get the data from the same date for the 'start date' and 'end date' I managed to do a filter range but let say I want the system to display the data on this particular date for ex: Start date: 2/3/23 End Date: 2/3/23 (ONLY) , instead of doing that, I have to enter a day before and a day after for example: Start date: 1/2/23 - End Date: 3/3/23 or Start Date: 2/3/23 - End Date: 3/3/23. Then, I could have the data for 2/3/23.

and this is what I did in the controller:

public function product (Request $request){

    $StartDate = $request->start_date ?? null;
    $EndDate= $request->end_date ?? null;
0 likes
4 replies
Snapey's avatar

depends what data you have in database? Date or datetime?

also, show your code if you want help

MissBeginner's avatar

@Snapey

@Snapey hello I am sorry if my reply will confuse u but here is my code: Please be informed that this coding is working but I just wanted to make a change as I mentioned before. please help me how can I change the code so that I can search the data for one day ( 7/6/23 -7/6/23)

CONTROLLER:

MissBeginner's avatar

@Snapey i never use this before, could u see my long reply including the code? Is it possible to chat using email or something?

Please or to participate in this conversation.