Menu

## TeacherProfile extends Model
in package
uses SoftDeletes, Common, HasFactory

TeacherProfile.php : 45

Class TeacherProfile

Model for managing teacher profile information.

##### Tags

mixin

### Table of Contents

#### Properties

$academic_year_id : int
$academicYear : AcademicYear
$avatarPath : string
$created_at : DateTime
$deleted_at : DateTime
$designation : string
$employee_id : string
$id : int
$pg_degree : int
$pgDegree : Qualification
$qualification : Qualification
$qualification_id : int
$reporting_to : int
$reportingTo : User
$school : School
$school_id : int
$specialization : string
$status : int
$sub_designation : string
$sub_qualification : string
$ug_degree : int
$ugDegree : Qualification
$updated_at : DateTime
$user : User
$user_id : int
$userprofile : Userprofile
$dates : array<string|int, mixed>
  The attributes that should be mutated to dates.
$fillable : array<string|int, mixed>
  The attributes that are mass assignable.
$table : string
  The table associated with the model.

#### Methods

academicYear() : BelongsTo
  Get the academic year for this profile.
eventImagePath() : string|null
  Resolve default event image path by category.
fileUpload() : string
  Write raw file contents to storage.
getAvatarPathAttribute() : string
  Get the avatar file path for this profile.
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).
pgDegree() : BelongsTo
  Get the postgraduate degree for this teacher.
putContents() : string
  Save plain contents to storage with public visibility.
putContentsByFilename() : string
  Save a file with a specific filename to storage.
qualification() : BelongsTo
  Get the qualification for this teacher.
reportingTo() : BelongsTo
  Get the user this teacher reports to.
romanToInteger() : int|null
  Convert a Roman numeral string to an integer.
school() : BelongsTo
  Get the school for this teacher.
ugDegree() : BelongsTo
  Get the undergraduate degree for this teacher.
unlinkFilePath() : bool
  Delete a file from the S3 disk.
uploadFile() : string
  Upload a file to storage and return its path.
user() : BelongsTo
  Get the user for this profile.
userprofile() : BelongsTo
  Get the user profile for this teacher.

### Properties

#### $academic_year_id

TeacherProfile.php : 0
`public int $academic_year_id`

#### $academicYear read-only

TeacherProfile.php : 0
`public AcademicYear $academicYear`

#### $avatarPath

TeacherProfile.php : 0
`public string $avatarPath`

#### $created_at

TeacherProfile.php : 0
`public DateTime $created_at`

#### $deleted_at

TeacherProfile.php : 0
`public DateTime $deleted_at`

#### $designation

TeacherProfile.php : 0
`public string $designation`

#### $employee_id

TeacherProfile.php : 0
`public string $employee_id`

#### $id

TeacherProfile.php : 0
`public int $id`

#### $pg_degree

TeacherProfile.php : 0
`public int $pg_degree`

#### $pgDegree read-only

TeacherProfile.php : 0
`public Qualification $pgDegree`

#### $qualification read-only

TeacherProfile.php : 0
`public Qualification $qualification`

#### $qualification_id

TeacherProfile.php : 0
`public int $qualification_id`

#### $reporting_to

TeacherProfile.php : 0
`public int $reporting_to`

#### $reportingTo read-only

TeacherProfile.php : 0
`public User $reportingTo`

#### $school read-only

TeacherProfile.php : 0
`public School $school`

#### $school_id

TeacherProfile.php : 0
`public int $school_id`

#### $specialization

TeacherProfile.php : 0
`public string $specialization`

#### $status

TeacherProfile.php : 0
`public int $status`

#### $sub_designation

TeacherProfile.php : 0
`public string $sub_designation`

#### $sub_qualification

TeacherProfile.php : 0
`public string $sub_qualification`

#### $ug_degree

TeacherProfile.php : 0
`public int $ug_degree`

#### $ugDegree read-only

TeacherProfile.php : 0
`public Qualification $ugDegree`

#### $updated_at

TeacherProfile.php : 0
`public DateTime $updated_at`

#### $user read-only

TeacherProfile.php : 0
`public User $user`

#### $user_id

TeacherProfile.php : 0
`public int $user_id`

#### $userprofile read-only

TeacherProfile.php : 0
`public Userprofile $userprofile`

#### $dates

TeacherProfile.php : 73

The attributes that should be mutated to dates.

`protected array<string|int, mixed> $dates = ['deleted_at']`

#### $fillable

TeacherProfile.php : 64

The attributes that are mass assignable.

`protected array<string|int, mixed> $fillable = ['school_id', 'academic_year_id', 'user_id', 'qualification_id', 'ug_degree', 'pg_degree', 'sub_qualification', 'specialization', 'designation', 'sub_designation', 'employee_id', 'reporting_to', 'status']`

#### $table

TeacherProfile.php : 57

The table associated with the model.

`protected string $table = 'teacherprofile'`

### Methods

#### academicYear()

TeacherProfile.php : 100

Get the academic year for this profile.

`public academicYear() : BelongsTo`

##### Return values

BelongsTo

#### 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

#### 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

#### getAvatarPathAttribute()

TeacherProfile.php : 160

Get the avatar file path for this profile.

`public getAvatarPathAttribute() : string`

##### Return values

string

#### 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

#### pgDegree()

TeacherProfile.php : 150

Get the postgraduate degree for this teacher.

`public pgDegree() : BelongsTo`

##### Return values

BelongsTo

#### 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

#### qualification()

TeacherProfile.php : 130

Get the qualification for this teacher.

`public qualification() : BelongsTo`

##### Return values

BelongsTo

#### reportingTo()

TeacherProfile.php : 120

Get the user this teacher reports to.

`public reportingTo() : BelongsTo`

##### Return values

BelongsTo

#### 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

#### school()

TeacherProfile.php : 80

Get the school for this teacher.

`public school() : BelongsTo`

##### Return values

BelongsTo

#### ugDegree()

TeacherProfile.php : 140

Get the undergraduate degree for this teacher.

`public ugDegree() : BelongsTo`

##### Return values

BelongsTo

#### 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

#### user()

TeacherProfile.php : 110

Get the user for this profile.

`public user() : BelongsTo`

##### Return values

BelongsTo

#### userprofile()

TeacherProfile.php : 90

Get the user profile for this teacher.

`public userprofile() : BelongsTo`

##### Return values

BelongsTo

## Search results