Menu

## AttendanceController extends Controller
in package
uses AcademicProcess, LogActivity, Common

AttendanceController.php : 35

Class AttendanceController

Controller for managing student attendance: listing, creating, exporting and retrieving student attendance data.

### Table of Contents

#### Methods

addStandard() : Standard
  Bulk create default standards for a school based on level selection.
create() : Response
  Show the form for creating a new resource.
createAttendance() : Attendance
  Record attendance for students and trigger notifications for absentees.
createSection() : Section
  Create a section for a school.
createStaffAttendance() : Attendance
  Record attendance for staff members and notify absent staff.
createStandard() : Standard
  Insert a single standard in relation to a reference standard order.
createStandardLink() : StandardLink
  Create a standard link and related teacher assignments.
createSubject() : Subject
  Create a subject within an academic year and link to standard/section.
doActivityLog() : mixed
  Fetches the activities of the logged in users.
editStandardLink() : StandardLink
  Update a standard link and refresh assigned teachers/subjects.
eventImagePath() : string|null
  Resolve default event image path by category.
export() : mixed
fileUpload() : string
  Write raw file contents to storage.
getFilePath() : string
  Get the public URL for a stored file.
getFilePathforDownload() : string
  Get file contents for download optionally from a specific disk.
getRequestIP() : string
  Retrieve the client IP address considering proxies.
is_admin() : bool
  Determine if a user ID belongs to an admin role (usergroup_id == 3).
list() : Response
  Show the form for creating a new resource.
putContents() : string
  Save plain contents to storage with public visibility.
putContentsByFilename() : string
  Save a file with a specific filename to storage.
romanToInteger() : int|null
  Convert a Roman numeral string to an integer.
store() : Response
  Store a newly created resource in storage.
student() : Response
  Show the form for creating a new resource.
studentList() : Response
  Show the form for creating a new resource.
unlinkFilePath() : bool
  Delete a file from the S3 disk.
uploadFile() : string
  Upload a file to storage and return its path.

### Methods

#### addStandard()

AcademicProcess.php : 37

Bulk create default standards for a school based on level selection.

`public addStandard(int $school_id, object $data) : Standard`

##### Parameters

$school_id : int

  School identifier

$data : object

  Request payload containing standards scope

##### Return values

Standard —

Last created standard model

#### create()

AttendanceController.php : 77

Show the form for creating a new resource.

`public create() : Response`

##### Return values

Response

#### createAttendance()

AcademicProcess.php : 359

Record attendance for students and trigger notifications for absentees.

`public createAttendance(int $school_id, int $academic_year_id, int $admin, object $data) : Attendance`

##### Parameters

$school_id : int

  School identifier

$academic_year_id : int

  Academic year identifier

$admin : int

  Admin user ID recording attendance

$data : object

  Request payload with absent/present lists and session info

##### Return values

Attendance —

Last saved attendance record

#### createSection()

AcademicProcess.php : 127

Create a section for a school.

`public createSection(int $school_id, object $data) : Section`

##### Parameters

$school_id : int

  School identifier

$data : object

  Request payload containing section name

##### Return values

Section —

Newly created section

#### createStaffAttendance()

AcademicProcess.php : 447

Record attendance for staff members and notify absent staff.

`public createStaffAttendance(int $school_id, int $academic_year_id, int $admin, object $data) : Attendance`

##### Parameters

$school_id : int

  School identifier

$academic_year_id : int

  Academic year identifier

$admin : int

  Admin user ID recording attendance

$data : object

  Request payload with absent/present staff data

##### Return values

Attendance —

Last saved attendance record

#### createStandard()

AcademicProcess.php : 90

Insert a single standard in relation to a reference standard order.

`public createStandard(int $school_id, object $data) : Standard`

##### Parameters

$school_id : int

  School identifier

$data : object

  Request payload containing standard name, reference id, and position

##### Return values

Standard —

Newly created standard

#### createStandardLink()

AcademicProcess.php : 188

Create a standard link and related teacher assignments.

`public createStandardLink(int $school_id, int $academic_year_id, object $data) : StandardLink`

##### Parameters

$school_id : int

  School identifier

$academic_year_id : int

  Academic year identifier

$data : object

  Request payload including class teacher, subjects, and counts

##### Return values

StandardLink —

Newly created standard link

#### createSubject()

AcademicProcess.php : 155

Create a subject within an academic year and link to standard/section.

`public createSubject(int $school_id, int $academic_year_id, object $data) : Subject`

##### Parameters

$school_id : int

  School identifier

$academic_year_id : int

  Academic year identifier

$data : object

  Request payload containing subject details

##### Return values

Subject —

Newly created subject

#### doActivityLog()

LogActivity.php : 15

Fetches the activities of the logged in users.

`public doActivityLog(string $performed_on, string $caused_by, text $properties, mixed $logname, text $message) : mixed`

##### Parameters

$performed_on : string
$caused_by : string
$properties : text
$logname : mixed
$message : text

#### editStandardLink()

AcademicProcess.php : 256

Update a standard link and refresh assigned teachers/subjects.

`public editStandardLink(int $school_id, int $academic_year_id, int $standardLink_id, object $data) : StandardLink`

##### Parameters

$school_id : int

  School identifier

$academic_year_id : int

  Academic year identifier

$standardLink_id : int

  Standard link identifier

$data : object

  Request payload including teacher/subject updates

##### Return values

StandardLink —

Updated standard link

#### eventImagePath()

Common.php : 118

Resolve default event image path by category.

`public eventImagePath(string $category, string $image) : string|null`

##### Parameters

$category : string

  Event category slug

$image : string

  Unused parameter kept for compatibility

##### Return values

string|null —

Public URL for the event image or null on failure

#### export()

AttendanceController.php : 124
`public export(mixed $standardLink_id) : mixed`

##### Parameters

$standardLink_id : mixed

#### fileUpload()

Common.php : 71

Write raw file contents to storage.

`public fileUpload(string $folder, string $file) : string`

##### Parameters

$folder : string

  Target path (including filename)

$file : string

  Raw file contents

##### Return values

string —

Storage path of the written file

#### getFilePath()

Common.php : 24

Get the public URL for a stored file.

`public getFilePath(string $file) : string`

##### Parameters

$file : string

  Storage path

##### Return values

string —

Publicly accessible URL or empty string on failure

#### getFilePathforDownload()

Common.php : 253

Get file contents for download optionally from a specific disk.

`public getFilePathforDownload([string $disk = '' ], string $file) : string`

##### Parameters

$disk : string = ''

  Storage disk name

$file : string

  File path

##### Return values

string —

File contents

#### getRequestIP()

Common.php : 93

Retrieve the client IP address considering proxies.

`public getRequestIP() : string`

##### Return values

string —

IP address

#### is_admin()

Common.php : 304

Determine if a user ID belongs to an admin role (usergroup_id == 3).

`public static is_admin(int|string $userid) : bool`

##### Parameters

$userid : int|string

  User identifier

##### Return values

bool —

True if user is admin, false otherwise

#### list()

AttendanceController.php : 46

Show the form for creating a new resource.

`public list() : Response`

##### Return values

Response

#### putContents()

Common.php : 157

Save plain contents to storage with public visibility.

`public putContents(string $folder, string $contents) : string`

##### Parameters

$folder : string

  Destination path

$contents : string

  File contents

##### Return values

string —

Storage path of the saved file

#### putContentsByFilename()

Common.php : 182

Save a file with a specific filename to storage.

`public putContentsByFilename(string $folder, UploadedFile $contents, string $filename) : string`

##### Parameters

$folder : string

  Destination folder

$contents : UploadedFile

  File instance

$filename : string

  Target filename

##### Return values

string —

Storage path of the saved file

#### romanToInteger()

Common.php : 205

Convert a Roman numeral string to an integer.

`public romanToInteger(string $roman) : int|null`

##### Parameters

$roman : string

  Roman numeral value

##### Return values

int|null —

Converted integer or null on failure

#### store()

AttendanceController.php : 91

Store a newly created resource in storage.

`public store(Request $request) : Response`

##### Parameters

$request : Request

##### Return values

Response

#### student()

AttendanceController.php : 210

Show the form for creating a new resource.

`public student() : Response`

##### Return values

Response

#### studentList()

AttendanceController.php : 236

Show the form for creating a new resource.

`public studentList(Request $request) : Response`

##### Parameters

$request : Request

##### Return values

Response

#### unlinkFilePath()

Common.php : 282

Delete a file from the S3 disk.

`public unlinkFilePath(string $file) : bool`

##### Parameters

$file : string

  File path on S3

##### Return values

bool —

True after attempting deletion

#### uploadFile()

Common.php : 47

Upload a file to storage and return its path.

`public uploadFile(string $folder, UploadedFile $file) : string`

##### Parameters

$folder : string

  Target folder path

$file : UploadedFile

  File to upload

##### Return values

string —

Storage path for the uploaded file

## Search results