Week 3: CRUD Operations + MPESA Integration

Master CRUD in Laravel by building a blog system. Then, bring it closer home by integrating MPESA payments — a must-have for developers building apps in Kenya.

Overview

This is where Laravel starts making real-world sense. You’ll build a simple CRUD blog engine and top it off with Safaricom’s MPESA Daraja API integration. We’re blending core Laravel concepts with **Kenyan-specific developer power**.

What You’ll Learn This Week

  • ✅ MVC (Model-View-Controller) applied to CRUD.
  • ✅ Laravel Models, Migrations, Controllers & Blade.
  • ✅ Creating blog posts, editing, deleting, and listing.
  • ✅ Form validation, CSRF, route-model binding.
  • ✅ How MPESA Daraja API works (STK Push logic).
  • ✅ Building a payment form connected to MPESA.
  • ✅ Handling Daraja callbacks and verifying success.
  • ✅ Storing payment transactions in the DB.

Weekly Project: Blog Posting + Pay-to-Publish

You’ll build a full CRUD blog manager. But with a twist — blog posts must be paid for via MPESA before going live. This is a real-world concept used in classified ads, job boards, and premium publishing platforms. You'll wire it up, test transactions, and confirm payments using Safaricom’s sandbox API.

Why This Matters

CRUD is the heartbeat of web development — almost every app relies on it. MPESA, on the other hand, is a **local superpower**. Knowing how to build with both means you’re not just learning Laravel — you’re solving real problems for real users, right here in Kenya and East Africa.

Outcomes

  • Be confident in building and structuring CRUD apps.
  • Know how MVC ties into dynamic Laravel workflows.
  • Send and receive real MPESA payments via Daraja API.
  • Handle real money and secure your backend logic.