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