/**
  * Update settings
  *
  * @param int $id
  *
  * @return \Illuminate\Http\Response
  */
 public function editSettings($id)
 {
     /**
      * @var $profile \Flocc\Profile
      */
     $profile = Profile::findOrFail($id);
     $partying = Profile\Partying::all();
     $alcohol = Profile\Alcohol::all();
     $smoking = Profile\Smoking::all();
     $imprecation = Profile\Imprecation::all();
     $plannings = Profile\Plannings::all();
     $plans = Profile\Plans::all();
     $vegetarian = Profile\Vegetarian::all();
     $flexibility = Profile\Flexibility::all();
     $plans_change = Profile\PlansChange::all();
     $verbosity = Profile\Verbosity::all();
     $vigor = Profile\Vigor::all();
     $cool = Profile\Cool::all();
     $rules = Profile\Rules::all();
     $opinions = Profile\Opinions::all();
     $tolerance = Profile\Tolerance::all();
     $compromise = Profile\Compromise::all();
     $feelings = Profile\Feelings::all();
     $emergency = Profile\Emergency::all();
     $features_sets = Profile\Features::where(['is_set' => '1'])->get();
     $features = Profile\Features::where(['is_set' => '0'])->get();
     $free_time = Profile\FreeTime::all();
     if (!empty(\Input::get())) {
         $post = \Input::get();
         if (isset($post['partying_id'])) {
             $profile->setPartyingId($post['partying_id']);
         }
         if (isset($post['alcohol_id'])) {
             $profile->setAlcoholId($post['alcohol_id']);
         }
         if (isset($post['smoking_id'])) {
             $profile->setSmokingId($post['smoking_id']);
         }
         if (isset($post['imprecation_id'])) {
             $profile->setImprecationId($post['imprecation_id']);
         }
         if (isset($post['imprecation_id'])) {
             $profile->setImprecationId($post['imprecation_id']);
         }
         if (isset($post['plannings_id'])) {
             $profile->setPlanningsId($post['plannings_id']);
         }
         if (isset($post['plans_id'])) {
             $profile->setPlansId($post['plans_id']);
         }
         if (isset($post['vegetarian_id'])) {
             $profile->setVegetarianId($post['vegetarian_id']);
         }
         if (isset($post['verbosity_id'])) {
             $profile->setVerbosityId($post['verbosity_id']);
         }
         if (isset($post['vigor_id'])) {
             $profile->setVigorId($post['vigor_id']);
         }
         if (isset($post['cool_id'])) {
             $profile->setCoolId($post['cool_id']);
         }
         if (isset($post['rules_id'])) {
             $profile->setRulesId($post['rules_id']);
         }
         if (isset($post['opinions_id'])) {
             $profile->setOpinionsId($post['opinions_id']);
         }
         if (isset($post['tolerance_id'])) {
             $profile->setToleranceId($post['tolerance_id']);
         }
         if (isset($post['compromise_id'])) {
             $profile->setCompromiseId($post['compromise_id']);
         }
         if (isset($post['feelings_id'])) {
             $profile->setFeelingsId($post['feelings_id']);
         }
         if (isset($post['emergency_id'])) {
             $profile->setEmergencyId($post['emergency_id']);
         }
         //->setFlexibilityId($post['flexibility_id'])
         //->setPlansChangeId($post['plans_change_id'])
         $profile->save();
         $users_features = new Features();
         $free_time_user = new FreeTime();
         $users_features->clear(\Flocc\Auth::getUserId());
         $free_time_user->clear(\Flocc\Auth::getUserId());
         if (isset($post['features'])) {
             foreach ($post['features'] as $feature_id) {
                 $users_features->addNew(\Flocc\Auth::getUserId(), $feature_id);
             }
         }
         if (isset($post['free_time'])) {
             foreach ($post['free_time'] as $free_time_id) {
                 $free_time_user->addNew(\Flocc\Auth::getUserId(), $free_time_id);
             }
         }
         $message = "Successfully updated";
     }
     return view('profiles.edit.settings', compact('message', 'profile', 'partying', 'alcohol', 'smoking', 'imprecation', 'plannings', 'plans', 'vegetarian', 'flexibility', 'plans_change', 'verbosity', 'vigor', 'cool', 'rules', 'opinions', 'tolerance', 'compromise', 'feelings', 'emergency', 'features', 'features_sets', 'errors', 'free_time'));
 }