Overview
The Teacher model manages teacher-specific operations including creation, retrieval, and deletion. File:app/models/Teacher.php
Methods
all
Retrieves all teachers with their user information. SQL Query:Returns array of all teacher records
create
Creates a new teacher record in both users and teachers tables.Teacher’s full name
Teacher’s email address
Plain text password (will be hashed)
No return value (throws exception on failure)
The password is automatically hashed using PHP’s
password_hash() with PASSWORD_DEFAULT algorithm.delete
Deletes a teacher record (cascades to teachers table via foreign key).Teacher ID to delete
No return value (throws exception on failure)