/** * Register custom Blade composers * * @return void */ private function bladeComposers() { /** * Master.Private */ view()->composer('master.private', function ($view) { /** * Provide counts of all Records */ $counts = array(); $counts['senders'] = Senders::all()->count(); $counts['targets'] = Targets::all()->count(); $counts['queue'] = Tweets::inQueue()->count(); $counts['sent'] = Tweets::areSent()->count(); $counts['failed'] = Tweets::haveFailed()->count(); $counts['flagged'] = Tweets::isFlagged()->count(); $view->with('counts', $counts); }); }
/** * Return the Queue page * * @return View */ public function getQueue() { $tweets = Tweets::inQueue()->get(); return view('private.queue')->with('tweets', $tweets); }
/** * Get Next Tweets from Queue * * @param (Optional) Integer $amount * @return Object */ private function next($amount = 4) { return Tweets::inQueue()->orderBy('id', 'ASC')->take($amount)->get(); }