Skip to main content

Real-World Scenario

You’re building an online learning platform where educational institutions, companies, or individual instructors create courses. Think Udemy for business, corporate training platforms, or school LMS systems. Each organization (team) needs to:
  • Create and manage courses and lessons
  • Enroll students and track their progress
  • Issue certificates upon course completion
  • View analytics and student performance
  • Manage instructors and content creators
This example shows a complete, production-ready learning management system with progress tracking, quizzes, and certification.

The Business Model

Platform Structure:
  • Each institution/company gets their own workspace (team)
  • Create unlimited courses with lessons and quizzes
  • Enroll students (team members) in specific courses
  • Track completion, scores, and issue certificates
  • Instructor roles can create/edit content
What Teams Get:
  • Dedicated learning environment for their organization
  • Course creation and management tools
  • Student enrollment and progress tracking
  • Automated certificate generation
  • Analytics and reporting dashboard

Database Structure

1. Courses Table

Core course information:

2. Lessons Table

Individual lessons within courses:

3. Enrollments Table

Track student enrollments in courses:

4. Lesson Progress Table

Track completion of individual lessons:

5. Quiz Results Table

Store quiz attempts and scores:

6. Certificates Table

Generate and store course completion certificates:

Complete Model Implementation

Course Model with Enrollment Logic

Enrollment Model with Progress Tracking

Certificate Model

Filament Resources

Course Resource

Student Dashboard Widget

Why This Example is Better

Complete Learning System

  • ✅ Full course management (courses, lessons, quizzes)
  • ✅ Student enrollment with progress tracking
  • ✅ Automated certificate generation
  • ✅ Quiz system with multiple attempts
  • ✅ Instructor role management
  • ✅ Time tracking per lesson

Production-Ready Features

  • ✅ Soft deletes on courses
  • ✅ Automatic progress calculation
  • ✅ Passing score requirements
  • ✅ Certificate expiration support
  • ✅ Course difficulty levels
  • ✅ Featured courses

Business Logic

  • ✅ Completion rate calculations
  • ✅ Average score tracking
  • ✅ Final score from best quiz attempts
  • ✅ Automatic certificate issuance
  • ✅ Enrollment expiration
  • ✅ Time spent formatting

Analytics & Reporting

  • ✅ Student count per course
  • ✅ Completion rates
  • ✅ Average scores
  • ✅ Progress percentages
  • ✅ Time tracking
  • ✅ Dashboard widgets

Next Steps