Example #1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     Feed::where('updated_at', '<=', Carbon::now()->subHours(1))->orWhereNull('updated_at')->chunk(10, function ($feeds) {
         foreach ($feeds as $feed) {
             $feed->updateFeed();
         }
     });
 }
Example #2
0
 public function view($id)
 {
     $feed = Feed::with(['items', 'items.image'])->findOrFail($id);
     $feedItems = FeedItem::has('image')->paginate(30);
     return view('feed/view', ['pageTitle' => $this->pageTitle([trans('feed.view.page-title', ['title' => $feed->title])]), 'feed' => $feed, 'feedItems' => $feedItems]);
 }