public function show(Photo $photo)
 {
     // $photo = Photo::findOrFail(Input::get('id'));
     $photos = Photo::all();
     $related = array();
     foreach ($photos as $dbphoto) {
         if ($dbphoto->category == $photo['category']) {
             array_push($related, $dbphoto);
         }
     }
     return View::make('show', compact('photo'))->with('related', $related);
 }
 public function all()
 {
     return Photo::all();
 }
 public function home()
 {
     $photos = Photo::all();
     return View::make('vtadmin', compact('photos'));
 }
 public function showPhotosIndex()
 {
     if (Auth::check()) {
         $userId = Auth::user()->id;
         $photos = Photo::all();
         $firstPhotos = array();
         $users = array();
         foreach ($photos as $photo) {
             if (!in_array($photo->user_id, $users) && $userId != $photo->user_id) {
                 array_push($firstPhotos, $photo);
                 array_push($users, $photo->user_id);
             }
         }
         return Response::json(array('error' => false, 'photos' => $firstPhotos), 200);
     } else {
         return Response::json(array('error' => true, 'reason' => 'not logged in'), 200);
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $this->_data['photos'] = Photo::all();
     return View::make('photo.index', $this->_data);
 }