public function getDaysUntilDeadlineAttribute() { return Carbon\Carbon::now()->startOfDay()->diffInDays($this->deadline, false); // if you are past your deadline, the value returned will be negative. }