setAttribute('star', $value); } public function toggleStar(): void { $star = boolval($this->getAttribute('star')); $this->setAttribute('star', ! $star); } protected static function makeStarSense(self $model): void { if ($model->isDirty('star')) { $session = resolve(Session::class); $session->flash('info', \trans( 'crud.messages.star_saved' )); } } }