Exemple #1
0
 /**
  * GET: /
  *
  * @return view(home.index)
  */
 public function getIndex()
 {
     $user = Auth::user();
     $profiles = $this->profileRepository->getFromUser($user);
     $providers = $this->providerRepository->getFromUserByProfile($user);
     return view('home.index', ['profiles' => $profiles, 'providers' => $providers]);
 }
 /**
  * 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;
 }
 /**
  * Remove the specified Profile from storage.
  *
  * @param  int $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     $profile = $this->profileRepository->find($id);
     if (empty($profile)) {
         Flash::error('Profile not found');
         return redirect(route('profiles.index'));
     }
     $this->profileRepository->delete($id);
     Flash::success('Profile deleted successfully.');
     return redirect(route('profiles.index'));
 }
 /**
  * DELETE: /profiles
  *
  * @return redirect(/profiles)
  */
 public function deleteIndex()
 {
     $profileId = Input::get('profile_id');
     $this->profileRepository->delete($profileId);
 }
 /**
  * Remove the specified Profile from storage.
  * DELETE /profiles/{id}
  *
  * @param  int $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     $this->profileRepository->apiDeleteOrFail($id);
     return $this->sendResponse($id, "Profile deleted successfully");
 }