Menu

## TeacherLeaveApplication extends Model
in package
uses SoftDeletes

TeacherLeaveApplication.php : 40

Class TeacherLeaveApplication

Model for managing teacher leave applications and approvals.

##### Tags

mixin

### Table of Contents

#### Properties

$absentReason : AbsentReason
$academic_year_id : int
$academicYear : AcademicYear
$approved_by : int
$approved_on : DateTime
$approvedUser : User
$comments : string
$created_at : DateTime
$deleted_at : DateTime
$from_date : DateTime
$id : int
$leave_type_id : int
$leaveType : LeaveType
$reason_id : int
$remarks : string
$school : School
$school_id : int
$standardLink : StandardLink
$status : int
$teacher : User
$to_date : DateTime
$updated_at : DateTime
$user_id : int
$casts : 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

absentReason() : BelongsTo
  Get the reason for absence if specified.
academicYear() : BelongsTo
  Get the academic year for this application.
approvedUser() : BelongsTo
  Get the user who approved this application.
leaveType() : BelongsTo
  Get the leave type for this application.
school() : BelongsTo
  Get the school for this application.
scopeByDate() : Builder
  Scope to filter applications by date range (overlapping dates).
standardLink() : BelongsTo
  Get the standard link for this application.
teacher() : BelongsTo
  Get the teacher who applied for leave.

### Properties

#### $absentReason read-only

TeacherLeaveApplication.php : 0
`public AbsentReason $absentReason`

#### $academic_year_id

TeacherLeaveApplication.php : 0
`public int $academic_year_id`

#### $academicYear read-only

TeacherLeaveApplication.php : 0
`public AcademicYear $academicYear`

#### $approved_by

TeacherLeaveApplication.php : 0
`public int $approved_by`

#### $approved_on

TeacherLeaveApplication.php : 0
`public DateTime $approved_on`

#### $approvedUser read-only

TeacherLeaveApplication.php : 0
`public User $approvedUser`

#### $comments

TeacherLeaveApplication.php : 0
`public string $comments`

#### $created_at

TeacherLeaveApplication.php : 0
`public DateTime $created_at`

#### $deleted_at

TeacherLeaveApplication.php : 0
`public DateTime $deleted_at`

#### $from_date

TeacherLeaveApplication.php : 0
`public DateTime $from_date`

#### $id

TeacherLeaveApplication.php : 0
`public int $id`

#### $leave_type_id

TeacherLeaveApplication.php : 0
`public int $leave_type_id`

#### $leaveType read-only

TeacherLeaveApplication.php : 0
`public LeaveType $leaveType`

#### $reason_id

TeacherLeaveApplication.php : 0
`public int $reason_id`

#### $remarks

TeacherLeaveApplication.php : 0
`public string $remarks`

#### $school read-only

TeacherLeaveApplication.php : 0
`public School $school`

#### $school_id

TeacherLeaveApplication.php : 0
`public int $school_id`

#### $standardLink read-only

TeacherLeaveApplication.php : 0
`public StandardLink $standardLink`

#### $status

TeacherLeaveApplication.php : 0
`public int $status`

#### $teacher read-only

TeacherLeaveApplication.php : 0
`public User $teacher`

#### $to_date

TeacherLeaveApplication.php : 0
`public DateTime $to_date`

#### $updated_at

TeacherLeaveApplication.php : 0
`public DateTime $updated_at`

#### $user_id

TeacherLeaveApplication.php : 0
`public int $user_id`

#### $casts

TeacherLeaveApplication.php : 68

The attributes that should be mutated to dates.

`protected array<string|int, mixed> $casts = ['from_date' => 'datetime', 'to_date' => 'datetime', 'deleted_at' => 'datetime']`

#### $fillable

TeacherLeaveApplication.php : 57

The attributes that are mass assignable.

`protected array<string|int, mixed> $fillable = ['school_id', 'academic_year_id', 'user_id', 'from_date', 'to_date', 'reason_id', 'remarks', 'leave_type_id', 'approved_by', 'approved_on', 'comments', 'status']`

#### $table

TeacherLeaveApplication.php : 50

The table associated with the model.

`protected string $table = 'teacher_leave_applications'`

### Methods

#### absentReason()

TeacherLeaveApplication.php : 119

Get the reason for absence if specified.

`public absentReason() : BelongsTo`

##### Return values

BelongsTo

#### academicYear()

TeacherLeaveApplication.php : 89

Get the academic year for this application.

`public academicYear() : BelongsTo`

##### Return values

BelongsTo

#### approvedUser()

TeacherLeaveApplication.php : 139

Get the user who approved this application.

`public approvedUser() : BelongsTo`

##### Return values

BelongsTo

#### leaveType()

TeacherLeaveApplication.php : 129

Get the leave type for this application.

`public leaveType() : BelongsTo`

##### Return values

BelongsTo

#### school()

TeacherLeaveApplication.php : 79

Get the school for this application.

`public school() : BelongsTo`

##### Return values

BelongsTo

#### scopeByDate()

TeacherLeaveApplication.php : 152

Scope to filter applications by date range (overlapping dates).

`public scopeByDate(Builder $query, DateTime $from_date, DateTime $to_date) : Builder`

##### Parameters

$query : Builder
$from_date : DateTime
$to_date : DateTime

##### Return values

Builder

#### standardLink()

TeacherLeaveApplication.php : 109

Get the standard link for this application.

`public standardLink() : BelongsTo`

##### Return values

BelongsTo

#### teacher()

TeacherLeaveApplication.php : 99

Get the teacher who applied for leave.

`public teacher() : BelongsTo`

##### Return values

BelongsTo

## Search results