/**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $authID = \Auth::user()->id;
     $stories = story::where('user_id', $id)->get();
     $profile = user::where('id', $id)->get();
     $thisProfiel = user::where('id', $id)->get()->first();
     // explore trip I made
     $explore = Expedition::where('user_id', $id)->get();
     // explore trips where I'm invite too
     $invexplore = Expfriend::select('expedition_id')->where('user_id', $id)->get();
     $invexplore = $invexplore->lists('expedition_id');
     $invexploration = Expedition::whereIn('id', $invexplore)->get();
     //my friends
     $listfriends = friend::select('friend_id')->where('user_id', $id)->where('state', 1)->get();
     $listfriends = $listfriends->lists('friend_id');
     $friends = user::whereIn('id', $listfriends)->get();
     //my invited for friends
     $notmyfriends = friend::select('user_id')->where('friend_id', $id)->where('state', 0)->get();
     $notmyfriends = $notmyfriends->lists('user_id');
     $invitefriends = user::whereIn('id', $notmyfriends)->get();
     if ($id == $authID) {
         $isthisme = "yes";
     } else {
         $isthisme = "no";
     }
     return view('profile.index', compact('stories', 'isthisme', 'friends', 'invitefriends', 'thisProfiel', 'explore', 'invexploration'));
 }
 /**
  * @param $confirmationCode
  * @return mixed
  * @throws InvalidConfirmationCodeException
  * @internal param $confirmation_code
  */
 public function confirm($confirmationCode)
 {
     if (!$confirmationCode) {
         throw new InvalidConfirmationCodeException();
     }
     $user = user::where('confirmation_code', 'LIKE', $confirmationCode)->first();
     if (!$user) {
         dd($user);
     }
     $user->confirmed = 1;
     $user->confirmation_code = null;
     $user->save();
     //Flash::message('You have successfully verified your account.');
     return Redirect::route('login');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateFriend $request)
 {
     $input = $request->all();
     $authU = \Auth::user()->id;
     $friend_mail = $input['email'];
     $friend_id = user::where('email', $friend_mail)->pluck('id');
     $friend_list = friend::where('user_id', $authU)->where('friend_id', $friend_id)->pluck('id');
     if ($authU == $friend_id) {
         return "u cant invite yourself to friends";
     } elseif (!empty($friend_list)) {
         return "friend is already your friend";
     } elseif (empty($friend_id)) {
         return "Persone u looking for isn't on Urban Tell, invite him/her";
     } else {
         $friend = new friend();
         $friend->user_id = $authU;
         $friend->friend_id = $friend_id;
         $friend->state = 0;
         $friend->save();
         return redirect('profile/' . $authU);
     }
 }
 public function showPatient($userId)
 {
     $patient = user::where('userId', $userId)->first();
     return view('nurse.recordPatientGeneralDetail2')->with('patient', $patient);
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $editor = \Auth::user()->id;
     $author = Story::where('id', $id)->pluck('user_id');
     if ($author == $editor) {
         $state = 'on';
         $story = Story::find($id);
         $parts = part::where('story_id', $id)->get();
         $author = user::where('id', $editor)->get()->first();
         return view('story.edit', compact('story', 'state', 'parts', 'author'));
     } else {
         return redirect('story/' . $id);
     }
 }
Beispiel #6
0
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $user = user::where('id', Auth::user()->id)->first();
     return view('game_room', compact('user'));
 }
 public function viewStudent($id)
 {
     if (!$this->auth()) {
         return "You have no Permissions!";
     }
     $user = user::where('id', '=', $id)->get();
     $user = $user[0];
     $pref = student_preferences::where('id', '=', $id)->get();
     $classes = student_classes::where('id', '=', $id)->get(array('classID'));
     return view('studentInfo', compact('user', 'pref', 'classes'));
 }
 public function postActive()
 {
     $obj = new user();
     $obj->where('remember_token', '=', Request::get('code'))->update(['status' => 'active']);
     return view('auth.login');
 }
Beispiel #9
0
 /**
  * Show the application dashboard.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $user = user::where('id', Auth::user()->id)->first();
     return view('welcome', compact('user'));
 }