/**
  * Display all videos of a user on the page.
  *
  * @return Response
  */
 public function index($id)
 {
     if ($this->checkIfGuestDoNotHavePermission($id, UserSettings::PRIVACY_TYPE_IMAGES)) {
         return redirect('/');
     }
     $images = null;
     $userProfile = null;
     try {
         $userProfile = UserProfile::findOrFail($id);
         $userProfile->getMutatedData = false;
         $images = $userProfile->images;
     } catch (ModelNotFoundException $e) {
         return abort(404);
     }
     return view('profile.userMedia.images', compact('images', 'userProfile'));
 }
 /**
  * Display all videos of a user on the page.
  *
  * @return Response
  */
 public function index($id)
 {
     if ($this->checkIfGuestDoNotHavePermission($id, UserSettings::PRIVACY_TYPE_VIDEOS)) {
         return redirect('/');
     }
     $videos = null;
     $userProfile = null;
     $youtube = new Youtube(array('key' => Dotenv::findEnvironmentVariable("GOOGLE_API_KEY_YOUTUBE")));
     try {
         $userProfile = UserProfile::findOrFail($id);
         $userProfile->getMutatedData = false;
         $videos = $userProfile->videos;
     } catch (ModelNotFoundException $e) {
         return abort(404);
     }
     return view('profile.userMedia.videos', compact('videos', 'userProfile', 'youtube'));
 }
 /**
  * Showing CV information of a talent or Manager
  * @param $user_id
  */
 public function viewCV($user_id)
 {
     if ($this->checkIfGuestDoNotHavePermission($user_id, UserSettings::PRIVACY_TYPE_PROFILE)) {
         return redirect('/');
     }
     $userProfile = null;
     try {
         $userProfile = UserProfile::findOrFail($user_id);
         $userProfile->getMutatedData = false;
     } catch (ModelNotFoundException $e) {
         return abort(404);
     }
     if (SiteConstants::isTalent($userProfile->user_type)) {
         $talentProfile = $userProfile;
         return view('profile.talent.viewTalentCV', compact('talentProfile'));
     } else {
         if (SiteConstants::isManager($userProfile->user_type)) {
             $managerProfile = ManagerProfile::find($userProfile->user_id);
             $careerInformation = $managerProfile->managerCareerInformation;
             return view('profile.manager.viewManagerCV', compact('managerProfile', 'careerInformation'));
         }
     }
     return redirect('profile');
 }