# Walkthrough: Teacher Curriculum and Timetable Scheduling

## Background
The Teacher Dashboard required functionality to manage curriculum schedules (Lesson Plans) and view specific Timetables effectively. This helps the teacher stay organized, set class objectives, and track custom or assigned class schedules natively in the app.

---

## What Was Completed

### 1. Database & Models Created
- **Lesson Plans (`lesson_plans` table)**: This tracks exactly what the teacher intends to teach per subject and class. Fields include `teacher_id`, `subject_id`, `school_class_id`, `title`, `description`, `date`, and `status`.
- **Timetables (`timetables` table)**: This organizes the weekly schedule. Fields include `teacher_id`, `subject_id`, `school_class_id`, `day_of_week`, `start_time`, `end_time`, and an explicit `type` column to distinguish "Regular" vs "Extra" classes.

### 2. Controllers and Routing
- **Routes**: Added `curriculum` and `timetable` as resource routes scoped to the `/teacher` prefix and `role:teacher` middleware inside `routes/web.php`.
- **CurriculumController**: Allows teachers to draft new lesson plans for the subjects they are assigned to, view upcoming ones, and mark progression out of the box using Eloquent's relationship queries.
- **TimetableController**: Exposes an endpoint to visually show grouped schedule slots (by Day of the Week), and provides a way for teachers to manually insert *Extra Classes* or overwrite standard periods.

### 3. Beautiful & Responsive Views
We implemented modern styling (matching the `teacher.dashboard` existing layout syntax) and interactive UI views underneath `resources/views/teacher/`:
- **Curriculum views** (`index`, `create`, `show`): A dynamic grid listing topics, their completion badges, and a detail view.
- **Timetable views** (`index`, `create`): A visual grouped table sorting Monday to Sunday schedule chunks dynamically. Extra classes render with a specific color cue and a quick-remove action.

## Testing Your Implementation
1. **Log in as a Teacher:** Access the teacher dashboard route.
2. **Curriculum Link:** Navigate using the sidebar to "Curriculum". Try creating a new Lesson Plan for today, add your description/objectives, and hit save!
3. **Timetable Link:** Navigate to "Timetable", press "Add Schedule Entry", set your class, subject, day 1 (Monday), with `start_time` and `end_time`, and classify it as *Extra*. You will see the interface correctly group the component!
