public function controlId() { $lastIn = Info::last(); $lastInYear = substr($lastIn->control_id, 0, 2); $lastInId = substr($lastIn->control_id, 3); $control_id = $this->yearNow() == $lastInYear ? $lastInId + 1 : 1; $this->control_id = $this->date()->format('y') . "-" . sprintf("%'.04d", $control_id); return $this; }