I have a live wire class that is supposed to get all the books at first render and then conditional query depending on user input for example if a user clicks on a certain category it returns a book that related to the category. So my question is how can I render my component with books without queries and when needed I serve the user with requested data?
public $typeId;
public $categoryId;
public $subCategoryId;
public function render()
{
$books = Book::where('book_type_id', $this->typeId)
->where('book_category_id', $this->categoryId)
->where('book_sub_category_id', $this->subCategoryId)
->paginate(12);
}