Beispiel #1
0
 /**
  * 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);
 }
Beispiel #3
0
 /**
  * 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;
 }