/** * Execute the command. * * @param ProfileRepository $repository * @return Startup */ public function handle(ProfileRepository $repository) { $profile = Profile::updateProfile($this->user, $this->data); $repository->save($profile); if (array_key_exists('skills', $this->data)) { $repository->updateSkills($profile, $this->data['skills']); } if (array_key_exists('image', $this->data) and !empty($this->data['image'])) { $repository->updateImage($profile); } return $profile; }