'boolean', 'archived' => 'boolean', ]; /** * Get the account record associated with the task. * * @return BelongsTo */ public function account() { return $this->belongsTo(Account::class); } /** * Get the contact record associated with the task. * * @return BelongsTo */ public function contact() { return $this->belongsTo(Contact::class); } /** * Limit tasks to completed ones. * * @param Builder $query * @return Builder */ public function scopeCompleted(Builder $query) { return $query->where('completed', true); } /** * Limit tasks to in-progress ones. * * @param Builder $query * @return Builder */ public function scopeInProgress(Builder $query) { return $query->where('completed', false); } }