class StudentSchoolClass extends BaseModel (View source)

Represents the view vw_student_school_class, which links students and school classes, including decrypted and formatted personal data (CPF, email, phone) for display and filtering.

Properties

bool $timestamps
protected string $table
protected array<int,string> $guarded
protected array<int,string> $hidden

Methods

save(array $options = [])

Prevents saving, enforcing read-only behavior for view models.

string|null
getIdAttribute(null|string $value)

Converts binary UUID (BLOB) to string representation.

null|string
getStudentIdAttribute(null|string $value)

Converts the binary UUID of the student to a string.

null|string
getSchoolClassIdAttribute(null|string $value)

Converts the binary UUID of the school class to a string.

string|null
getCpfAttribute(null|string $value)

Decrypts and formats the student's CPF.

string|null
getEmailAttribute(null|string $value)

Decrypts and returns the student's email.

string|null
getPhoneAttribute(null|string $value)

Decrypts and formats the student's phone number.

BelongsTo
student()

Defines the relationship between the record and its corresponding student.

BelongsTo
schoolClass()

Defines the relationship between the record and its corresponding school class.

static Collection
getFilterData(null|Builder $query = null)

Retrieves unique combinations of course, period, term, and borrowing permission to be used as filter data.

Details

save(array $options = [])

Prevents saving, enforcing read-only behavior for view models.

Parameters

array $options

Exceptions

Exception

string|null getIdAttribute(null|string $value)

Converts binary UUID (BLOB) to string representation.

Parameters

null|string $value

Return Value

string|null

null|string getStudentIdAttribute(null|string $value)

Converts the binary UUID of the student to a string.

Parameters

null|string $value

Binary UUID value

Return Value

null|string

UUID as string or null

null|string getSchoolClassIdAttribute(null|string $value)

Converts the binary UUID of the school class to a string.

Parameters

null|string $value

Binary UUID value

Return Value

null|string

UUID as string or null

string|null getCpfAttribute(null|string $value)

Decrypts and formats the student's CPF.

Example output: 123.456.789-00

Parameters

null|string $value

Encrypted CPF

Return Value

string|null

Decrypted and formatted CPF, or null if unavailable

string|null getEmailAttribute(null|string $value)

Decrypts and returns the student's email.

Parameters

null|string $value

Encrypted email

Return Value

string|null

Decrypted email or null if unavailable

string|null getPhoneAttribute(null|string $value)

Decrypts and formats the student's phone number.

Example output: (12) 34567-8901

Parameters

null|string $value

Encrypted phone number

Return Value

string|null

Decrypted and formatted phone number, or null if unavailable

BelongsTo student()

Defines the relationship between the record and its corresponding student.

Return Value

BelongsTo

BelongsTo schoolClass()

Defines the relationship between the record and its corresponding school class.

Return Value

BelongsTo

static Collection getFilterData(null|Builder $query = null)

Retrieves unique combinations of course, period, term, and borrowing permission to be used as filter data.

Parameters

null|Builder $query

Optional query builder instance

Return Value

Collection

Filtered data collection