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

itrabbi24's avatar

Search With Date Picker and show result

How I create a simple data search page with a date picker in laravel, I found some package but I cannot use those packages please help me. Database MYSQL From QureyBuilder

0 likes
2 replies
drewdan's avatar

Just create a page with a form containing a date picker, the html5 date picker should do the job, pass the data back to the controller and perform your query. Eloquent has some helpful whereDate methods to make the query generation that little bit cleaner and easier.

Once you've done that, show a view and give it the collection of results and output it

fylzero's avatar
fylzero
Best Answer
Level 67

@itrabbi24 Using a date picker is pretty well documented in Javascript land. If you need something simple for Bootstrap, check out jQuery UI. https://jqueryui.com/datepicker/

Beyond that, when handling date searching Laravel makes it super easy. Laravel has Carbon built in, so it is very easy to do Carbon::parse($start_date)->toDateTimeString(), etc. on your date objects and pass that to your queries.

Even easier if you use Eloquent, but with Querybuilder just use those strings in your query.

Please or to participate in this conversation.