'openSearchPanel']; public function openSearchPanel(): void { $this->showSearch = true; } public function findMovies(MovieDbInterface $movie_db): void { try { logger()->info("finding movies"); //$movie = $movie_db->search($this->query, ["type" => "imdb"]); $this->results = $movie_db->search($this->query, ["type" => "title"]); logger()->info($this->results); } catch (NotFoundHttpException $e) { $this->addError('query', 'Movie not found'); } } public function addMovie(MovieDbInterface $movieDb, string $imdbId): void { $this->resetErrorBag(); $movie = $movieDb->searchByImdbId($imdbId); $list = MovieListModel::find($this->listId); $list->movies()->syncWithoutDetaching($movie->id); $this->dispatch('movie-added'); $this->showSearch = false; $this->query = ''; $this->results = []; } public function render() { return view('livewire.search-panel'); } }