class Student extends BaseModel (View source)

Represents a view model for students.

This model maps to the database view vw_students, which stores decrypted and formatted student data for display and processing.

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.

string|null
getCpfAttribute(null|string $value)

Decrypts and returns 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.

BelongsToMany
schoolClasses()

Defines the many-to-many relationship between students and school classes.

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

string|null getCpfAttribute(null|string $value)

Decrypts and returns the student's CPF.

Parameters

null|string $value

Encrypted CPF value

Return Value

string|null

Decrypted CPF or null if unavailable

string|null getEmailAttribute(null|string $value)

Decrypts and returns the student's email.

Parameters

null|string $value

Encrypted email value

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 value

Return Value

string|null

Decrypted and formatted phone number, or null if unavailable

BelongsToMany schoolClasses()

Defines the many-to-many relationship between students and school classes.

Uses the view vw_student_school_class as the pivot table.

Return Value

BelongsToMany