Example #1
0
 /**
  * @return array
  */
 public function getOptions()
 {
     $options = $this->profileFieldOptionRepository->getForProfileField($this->getWrappedObject());
     $formattedOptions = [];
     foreach ($options as $option) {
         $formattedOptions[$option->getValue()] = $option->getName();
     }
     return $formattedOptions;
 }
 /**
  * @param SaveProfileFieldOptionRequest $request
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function saveNewProfileFieldOption(SaveProfileFieldOptionRequest $request)
 {
     $data = ['name' => $request->get('name'), 'value' => $request->get('name'), 'profile_field_id' => $request->get('profile_field_id')];
     $this->profilefieldOptionRepository->create($data);
     return redirect()->back()->withSuccess(trans('admin::general.success_created'));
 }