Menu

## Task extends Model
in package
uses SoftDeletes

Task.php : 42

Class Task

Model for managing user tasks with reminders and assignments.

##### Tags

mixin

### Table of Contents

#### Properties

$academic_year_id : int
$academicYear : AcademicYear
$created_at : DateTime
$deleted_at : DateTime
$flag : string
$id : int
$overDueTask : int
$reminder : string
$reminder_date : DateTime
$reminderValue : string
$school : School
$school_id : int
$task_date : DateTime
$task_flag : int
$task_status : int
$taskAssignee : Collection|array<string|int, TaskAssignee>
$title : string
$to_do_list : string
$todayTask : int
$type : string
$upcomingTask : int
$updated_at : DateTime
$user : Collection|array<string|int, User>
$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

academicYear() : BelongsTo
  Get the academic year for this task.
getFlagAttribute() : string
  Get the flag label for this task.
getOverDueTaskAttribute() : int
  Get count of overdue tasks.
getReminderValueAttribute() : string
  Get the calculated reminder value based on reminder setting.
getTodayTaskAttribute() : int
  Get count of today tasks.
getUpcomingTaskAttribute() : int
  Get count of upcoming tasks.
school() : BelongsTo
  Get the school for this task.
scopeByStatus() : Builder
  Scope to filter tasks by status.
scopeByType() : Builder
  Scope to filter tasks by type (by_me or assigned).
taskAssignee() : HasMany
  Get task assignees for this task.
user() : HasMany
  Get users assigned to this task.

### Properties

#### $academic_year_id

Task.php : 0
`public int $academic_year_id`

#### $academicYear read-only

Task.php : 0
`public AcademicYear $academicYear`

#### $created_at

Task.php : 0
`public DateTime $created_at`

#### $deleted_at

Task.php : 0
`public DateTime $deleted_at`

#### $flag

Task.php : 0
`public string $flag`

#### $id

Task.php : 0
`public int $id`

#### $overDueTask

Task.php : 0
`public int $overDueTask`

#### $reminder

Task.php : 0
`public string $reminder`

#### $reminder_date

Task.php : 0
`public DateTime $reminder_date`

#### $reminderValue

Task.php : 0
`public string $reminderValue`

#### $school read-only

Task.php : 0
`public School $school`

#### $school_id

Task.php : 0
`public int $school_id`

#### $task_date

Task.php : 0
`public DateTime $task_date`

#### $task_flag

Task.php : 0
`public int $task_flag`

#### $task_status

Task.php : 0
`public int $task_status`

#### $taskAssignee read-only

Task.php : 0
`public Collection|array<string|int, TaskAssignee> $taskAssignee`

#### $title

Task.php : 0
`public string $title`

#### $to_do_list

Task.php : 0
`public string $to_do_list`

#### $todayTask

Task.php : 0
`public int $todayTask`

#### $type

Task.php : 0
`public string $type`

#### $upcomingTask

Task.php : 0
`public int $upcomingTask`

#### $updated_at

Task.php : 0
`public DateTime $updated_at`

#### $user read-only

Task.php : 0
`public Collection|array<string|int, User> $user`

#### $user_id

Task.php : 0
`public int $user_id`

#### $casts

Task.php : 70

The attributes that should be mutated to dates.

`protected array<string|int, mixed> $casts = ['task_date' => 'datetime', 'reminder_date' => 'datetime']`

#### $fillable

Task.php : 59

The attributes that are mass assignable.

`protected array<string|int, mixed> $fillable = ['school_id', 'academic_year_id', 'user_id', 'title', 'type', 'task_date', 'reminder', 'reminder_date', 'to_do_list', 'task_status', 'task_flag']`

#### $table

Task.php : 52

The table associated with the model.

`protected string $table = 'task'`

### Methods

#### academicYear()

Task.php : 90

Get the academic year for this task.

`public academicYear() : BelongsTo`

##### Return values

BelongsTo

#### getFlagAttribute()

Task.php : 212

Get the flag label for this task.

`public getFlagAttribute() : string`

##### Return values

string

#### getOverDueTaskAttribute()

Task.php : 120

Get count of overdue tasks.

`public getOverDueTaskAttribute() : int`

##### Return values

int

#### getReminderValueAttribute()

Task.php : 150

Get the calculated reminder value based on reminder setting.

`public getReminderValueAttribute() : string`

##### Return values

string

#### getTodayTaskAttribute()

Task.php : 110

Get count of today tasks.

`public getTodayTaskAttribute() : int`

##### Return values

int

#### getUpcomingTaskAttribute()

Task.php : 130

Get count of upcoming tasks.

`public getUpcomingTaskAttribute() : int`

##### Return values

int

#### school()

Task.php : 80

Get the school for this task.

`public school() : BelongsTo`

##### Return values

BelongsTo

#### scopeByStatus()

Task.php : 176

Scope to filter tasks by status.

`public scopeByStatus(Builder $query, int $status) : Builder`

##### Parameters

$query : Builder
$status : int

##### Return values

Builder

#### scopeByType()

Task.php : 191

Scope to filter tasks by type (by_me or assigned).

`public scopeByType(Builder $query, string $type, int $user_id) : Builder`

##### Parameters

$query : Builder
$type : string
$user_id : int

##### Return values

Builder

#### taskAssignee()

Task.php : 140

Get task assignees for this task.

`public taskAssignee() : HasMany`

##### Return values

HasMany

#### user()

Task.php : 100

Get users assigned to this task.

`public user() : HasMany`

##### Return values

HasMany

## Search results