Menu

## StudentService
in package

StudentService.php : 33

Class StudentService

Service class responsible for handling student-related academic operations such as:

- Fetching student details
- Retrieving marks and exam performance
- Comparing exam results

This service is designed to be consumed by controllers, Livewire components, or APIs.

### Table of Contents

#### Methods

compareMarks() : View
  Compare marks of a student between two exams.
getAllMarks() : Collection
  Get all marks of a student across exams.
getAttendanceInfo() : mixed
  Get student attendance information.
getBasicInfo() : mixed
  Get basic student information.
getClassRoomInfo() : mixed
  Get classroom-related information for a student.
getLessonPlanForDay() : mixed
  Get lesson plan for a given day.
getMemosOrKudos() : mixed
  Get memos or kudos for a given day.
getStudentMark() : Collection
  Get marks of a student for a specific exam.
getSubjectsList() : mixed
  Get list of subjects associated with the student.
getTeachersList() : mixed
  Get list of teachers associated with the student.
pastClassroomEventsList() : mixed
  Get list of past classroom events.
test() : string
  Test method to verify service availability.
upcomingClassroomEventsList() : mixed
  Get list of upcoming classroom events.
getStudentById() : User
  Retrieve a student user by ID.

### Methods

#### compareMarks()

StudentService.php : 250

Compare marks of a student between two exams.

`public compareMarks(int|string $studentId, int|string $examIdOne, int|string $examIdTwo, int|string $standardId) : View`

Generates comparison data including:

- Student marks for both exams
- Subject-wise class average
- Exam names

##### Parameters

$studentId : int|string
$examIdOne : int|string
$examIdTwo : int|string
$standardId : int|string

##### Return values

View

#### getAllMarks()

StudentService.php : 220

Get all marks of a student across exams.

`public getAllMarks(int|string $studentId) : Collection`

Groups marks by exam name.

##### Parameters

$studentId : int|string

##### Return values

Collection

#### getAttendanceInfo()

StudentService.php : 90

Get student attendance information.

`public getAttendanceInfo(int|string $studentId, string $period) : mixed`

Period examples:

- today
- this week
- this month
- academic year so far

##### Parameters

$studentId : int|string
$period : string

#### getBasicInfo()

StudentService.php : 72

Get basic student information.

`public getBasicInfo(int|string $studentId) : mixed`

##### Parameters

$studentId : int|string

#### getClassRoomInfo()

StudentService.php : 108

Get classroom-related information for a student.

`public getClassRoomInfo(int|string $studentId) : mixed`

Example data:

- Standard
- Section
- Number of students
- Class teacher
- Average attendance rate

##### Parameters

$studentId : int|string

#### getLessonPlanForDay()

StudentService.php : 169

Get lesson plan for a given day.

`public getLessonPlanForDay(int|string $studentId, string $day) : mixed`

Day examples:

- today
- yesterday
- tomorrow

##### Parameters

$studentId : int|string
$day : string

#### getMemosOrKudos()

StudentService.php : 181

Get memos or kudos for a given day.

`public getMemosOrKudos(int|string $studentId, string $day) : mixed`

##### Parameters

$studentId : int|string
$day : string

#### getStudentMark()

StudentService.php : 195

Get marks of a student for a specific exam.

`public getStudentMark(int|string $studentId, int|string $examId) : Collection`

Groups marks by exam name.

##### Parameters

$studentId : int|string
$examId : int|string

##### Return values

Collection

#### getSubjectsList()

StudentService.php : 130

Get list of subjects associated with the student.

`public getSubjectsList(int|string $studentId) : mixed`

##### Parameters

$studentId : int|string

#### getTeachersList()

StudentService.php : 119

Get list of teachers associated with the student.

`public getTeachersList(int|string $studentId) : mixed`

##### Parameters

$studentId : int|string

#### pastClassroomEventsList()

StudentService.php : 152

Get list of past classroom events.

`public pastClassroomEventsList(int|string $studentId) : mixed`

##### Parameters

$studentId : int|string

#### test()

StudentService.php : 40

Test method to verify service availability.

`public test() : string`

##### Return values

string

#### upcomingClassroomEventsList()

StudentService.php : 141

Get list of upcoming classroom events.

`public upcomingClassroomEventsList(int|string $studentId) : mixed`

##### Parameters

$studentId : int|string

#### getStudentById()

StudentService.php : 55

Retrieve a student user by ID.

`private getStudentById(int|string $studentId) : User`

Ensures the user belongs to the student user group.

##### Parameters

$studentId : int|string

##### Tags

throws
  ModelNotFoundException

##### Return values

User

## Search results