/** * Execute the job. * * @return void */ public function handle(DocumentIndexRepository $documentIndexRepo) { $document = ['content' => $this->content, 'owner' => Auth::user()->id, 'title' => $this->title, 'words' => str_word_count(strip_tags($this->content), 1)]; $documentIndexRepo->create($document); }