Tutorials
The rest of this site answers questions about one API at a time. These pages build something end to end — the whole path from an empty Laravel application to a payment you can prove arrived.
Each one is a working integration rather than a snippet, and each says what breaks in production as well as what works in sandbox. Read them in order, or jump to the one you need: each lists what it assumes at the top.
- 02Testing callbacks on localhostReceive and test M-Pesa callbacks from a local Laravel application, with and without a tunnel.5 min read
- 03M-Pesa checkout with LivewireA Livewire component that pushes an M-Pesa prompt and updates itself when the payment lands.5 min read
- 04M-Pesa checkout for a SPA or mobile appTwo Laravel endpoints and a polling client — an M-Pesa checkout for a Vue, React or Flutter front end.8 min read
- 05Receive Paybill and till paymentsTake M-Pesa payments customers start themselves — register the URLs, record the money, and match it to an invoice.8 min read
- 06Take payment by QR codeGenerate M-Pesa QR codes in Laravel, display them, and work out which one was actually paid.7 min read
- 07Send money to customersB2C payouts and refunds in Laravel — credentials, idempotency, results, and the states in between.9 min read
- 08Subscriptions and recurring paymentsRecurring M-Pesa billing in Laravel — M-Pesa Ratiba, and the scheduled prompt everyone builds instead.7 min read
- 09One app, many short codesMulti-tenant M-Pesa in Laravel — per-merchant credentials, scoped calls, and routing callbacks to the right tenant.7 min read
Then keep it running
Section titled “Then keep it running”Taking one payment is the easy half. These guides cover the part that decides whether your books are right a month later:
- Reconciling payments — find the payments whose callbacks never arrived, and prove the ones that did.
- Handling callbacks — the routes, the events, and why a callback is not a record.
- Going live — what Safaricom requires before real money moves.
Laravel Daraja is free and open source, maintained by eazysoft.
An independent open-source project, not affiliated with, endorsed by, or sponsored by Safaricom PLC or Laravel LLC. M-Pesa and Daraja are trademarks of Safaricom PLC; Laravel is a trademark of Laravel LLC. Used here only to say what this package works with.