public function index() { if (Auth::check()) { Session::regenerate(); $notesTable = Notes::select('notes')->where('email', Auth::user()->email)->first()->toArray(); $notes = $notesTable["notes"]; $tbdTable = TBD::select('tbd')->where('email', Auth::user()->email)->first()->toArray(); $tbd = $tbdTable["tbd"]; $linksTable = Links::select('links')->where('email', Auth::user()->email)->get()->toArray(); $linksArray = array(); foreach ($linksTable as $link) { array_push($linksArray, $link["links"]); } $imagesTable = Image::select('image')->where('email', Auth::user()->email)->get()->toArray(); $imageArray = array(); foreach ($imagesTable as $image) { array_push($imageArray, $image["image"]); } $profile = array("notes" => $notes, "tbd" => $tbd, "links" => $linksArray, "image" => $imageArray, "email" => Auth::user()->email); return View::make('profile')->with('profile', $profile); } else { echo "NOT LOGGED IN!<br />"; return Redirect::to('/'); } }