Ejemplo n.º 1
0
 public function search($search)
 {
     $newsResult = News::search($search)->get()->toArray();
     $articleResult = Article::search($search)->get()->toArray();
     $photoGalleryResult = PhotoGallery::search($search)->get()->toArray();
     $result = array_merge($newsResult, $articleResult, $photoGalleryResult);
     return $result;
 }
Ejemplo n.º 2
0
 public function index()
 {
     $items = News::orderBy('created_at', 'desc')->take(10)->get();
     $data = array();
     foreach ($items as $k => $v) {
         $data[] = array('title' => $v->title, 'description' => $v->content, 'link' => url($v->url));
     }
     $feed = Feeder::feed($data);
     return Response::make($feed, 200, array('Content-Type' => 'text/xml'));
 }