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

Dimitrios's avatar

How to create a Laravel based web service for online reservations

Hello there. I need to develop a system where anyone can request a cab. A user can request a cab at any time (now or in future). The app sends notifications to Cab Drivers through Firebase and then it checks those who are interested to get the route and inform the winning driver!

My issue is that I do all checks currently with laravel crons, which is bad practise as I face many issues. I thought of using Queues but I don't know if that would help or just make it worse. I was thinking of a manual service which will trigger when a new booking is placed.

When the booking is placed, if its for near future, the listener should pause it and when time comes, it will resume it again and tries to get the cab drivers...

We also try to take care of situations like no drivers online.

Can you advise any way to make it through listeners, than querying database every 1 minute with cron and to avoid such issues ?

0 likes
3 replies
martinbean's avatar

@Dimitrios So you’re essentially asking how to build a clone of Uber?

I can guarantee they won’t be using cron jobs. That’s just a horribly inefficient way to do event broadcasting like that. You want to look into something like web sockets.

Dimitrios's avatar

No Uber, just a local company which used to call center but need more dynamic. Can Laravel support web sockets or similar ?

I though queues but I dont know what time they execute or when the loop runs (is it like cron every minute at least?)

1 like
t0berius's avatar

Using cronjobs could be used to handle this, but for sure Uber for example won't use them, they use realtime stuff (for sure they don't use PHP for their system too ;) ). You can use queues (for example SQS), but keep in mind, SQS can only store items for +15 minutes.

1 like

Please or to participate in this conversation.