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