What MVC concept am I learning with leafphp or Laravel framework?

I have already touched routing, controllers, models, migrations, and basic CRUD with leafphp framework — that’s the core of MVC. Now the goal is to go wider and deeper, not just add random fields.

I’ll suggest learning steps, not just features, and explain why each one matters in LeafPHP MVC terms. The GitHub URL to access the project files.

1️⃣ Improve the members domain (but with purpose)

Instead of “just adding fields”, add features that teach concepts.

a) Add real-world fields + validation

Add fields like:

  • email
  • phone
  • status (active / inactive)
  • notes

What you learn

  • Request validation
  • Custom validation rules
  • Error handling & flash messages

Example learning goal:

“Member email must be unique and valid”

This forces you to learn:

  • Validation layer
  • Controller responsibility vs Model responsibility

b) Soft delete (very important)

Add:

  • deleted_at column

Tasks

  • Hide soft-deleted members from listing
  • Add “Restore member”
  • Add “Permanently delete”

What you learn

  • Query scopes
  • Model logic
  • Cleaner controller code
  • Real-world data safety

This is huge for MVC maturity.


2️⃣ Relationships (this is where MVC clicks)

You already mentioned this — good instinct.

a) Connect members with users

Even though:

members ≠ logged-in users

That’s perfect.

Example:

  • A user creates many members
  • members.user_id

What to implement

  • One-to-many relationship
  • Show “Created by” in member list
  • Restrict editing to creator only

What you learn

  • Model relationships
  • Authorization logic
  • Cleaner controllers

This is where beginners usually level up.


3️⃣ Authorization (not authentication)

Login already exists — now control access.

Tasks

  • Only logged-in users can CRUD members
  • Only creator can edit/delete
  • Admin can see all members

What you learn

  • Middleware
  • Policies / guards
  • Role-based logic

MVC apps feel real after this.


4️⃣ Search, filter, pagination (very practical)

Add:

  • Search members by name/email
  • Filter by status
  • Pagination

What you learn

  • Query building
  • Request parameters
  • Keeping controllers slim
  • Reusable logic

Bonus:

  • Combine search + pagination (harder than it looks)

5️⃣ Refactor: move logic OUT of controllers

Once things work, clean them up.

Tasks

  • Move query logic into Model
  • Create service classes (optional)
  • Keep controllers thin

Goal

Controller should read like a story, not logic soup.

This teaches real MVC discipline, not just “it works”.


6️⃣ API version of members (very powerful)

Expose your members as an API:

  • GET /api/members
  • POST /api/members

Use the same models, different controllers.

What you learn

  • API controllers
  • JSON responses
  • Status codes
  • Reusability of MVC structure

This is 🔥 for learning.


7️⃣ File upload (profile image)

Add:

  • profile_image for members

Tasks

  • Upload
  • Validate type & size
  • Store path in DB
  • Show image

What you learn

  • Request handling
  • File storage
  • Security concerns

Almost every real app needs this.


8️⃣ Testing (even basic)

Write simple tests:

  • Create member
  • Validation fails
  • Soft delete works

What you learn

  • Confidence in code
  • How MVC pieces work together

Even 2–3 tests matter.


Suggested Learning Order (TL;DR)

If I had to give you a clean roadmap:

  1. Validation + better member fields
  2. Soft delete + restore
  3. Member ↔ User relationship
  4. Authorization (who can do what)
  5. Search + filter + pagination
  6. Refactor controllers (thin controllers)
  7. API version of members
  8. File upload
  9. Basic tests