Ejemplo n.º 1
0
 public function getPublishers($publisher)
 {
     $data['publisher_name'] = $publisher;
     //Get Publisher information
     $data['publisher_cover'] = Comicbooks::publishers($publisher)->select('cover_image')->orderBy('published_date', 'asc')->distinct()->get();
     $data['publisher_works'] = Comicbooks::publishers($publisher)->select('book_name')->orderBy('published_date', 'asc')->distinct()->get();
     //Check to see if publisher exist in database. If it doesn't Redirect to a wiki page
     $data['has_publisher'] = count($data['publisher_works']) ? true : false;
     if (!$data['has_publisher']) {
         return Redirect::away("http://en.wikipedia.org/wiki/" . ucwords($publisher));
     }
     $this->layout->content = View::make('publisher', $data);
 }