/** * Fetches and saves all available information about titles, * that arent fully scraped in database. * * @param int/string $amount * @return int/string */ public function inDb($amount = 10) { ini_set('max_execution_time', 0); $titles = $this->title->scrapable($amount); $count = 0; foreach ($titles as $k => $v) { $title = App::make('Lib\\Titles\\TitleRepository'); $title->getCompleteTitle($v); $count++; } return $count; }
/** * Restrict paginate query by given params. * * @param array $params * @param Builder $query * @return Builder */ protected function appendParams(array $params, $query) { //append all the params to query from base paginate method $query = parent::appendParams($params, $query)->with('Link'); if (isset($params['availToStream']) && $params['availToStream'] && $params['availToStream'] !== 'false') { $query->has('Link'); } return $query; }