/** * Execute the console command. * * @return mixed */ public function handle() { $this->search = Search::find($this->argument('search_id')); if ($this->search === null) { return false; } return $this->crawler->run($this->search); }
/** * Give the user a file containing all the search resources. * * @param int $searchId * @return \Illuminate\Http\RedirectResponse|\Symfony\Component\HttpFoundation\BinaryFileResponse */ public function download($searchId) { $resources = Search::find($searchId)->resources()->get()->lists('name')->unique()->toArray(); return $this->respondWithFile($resources); }
/** * Check if the search has been deleted or marked as finished. * * @return bool */ protected function searchIsDeletedOrFinished() { $search = Search::find($this->search->id)->first(); if ($search && $search->finished != true) { return false; } return true; }