Download the PHP package joshhanley/livewire-autocomplete without Composer

On this page you can find all versions of the php package joshhanley/livewire-autocomplete. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package livewire-autocomplete

Livewire Autocomplete

An autocomplete select component designed for use with Livewire that allows you to search through results or add a new one.

Requirements

Upgrades

Version 1.x of this package supports Livewire V2.

If you want to use this with Livewire V3, you will need to upgrade to version 2.x of this package.

There shouldn't be any breaking changes that you have to deal with, as all the breaking changes are internal.

Note: Livewire V3 no longer supports Eloquent Model binding out of the box. If you are using Eloquent Models in your autocomplete search results (as previously recommended by this package), you can enable legacy_model_binding in Livewire V3. It's not recommended to use legacy model binding in Livewire V3, so it should only be used to assist with upgrading and refactoring away from models.

Installation

To install the package run

Once the composer install finishes, the next step is to configure Tailwind to look for the autocomplete components, so all the styles are generated correctly.

In your tailwind.config.js file, add the path to the autocomplete view directory to the end of the content array:

And that's it, we have everything we need.

Usage

This autocomplete component is a blade component design to be used within a Livewire component. It won't work as a standalone component, without Livewire.

Demo App

The source code for a demo of this Livewire Autocomplete component can be found here here https://github.com/joshhanley/livewire-autocomplete-demo

Example API

Wire Bindings

Events

Add new event example

Options and Components

Options and components have defaults set in the config file, which can be published and overridden changing all autocomplete components. Then individual options and components can be passed into each instance of the component through the props, and an array merge happens inside of the autocomplete class to populate any overrides.

Options

Components

Components can be published to your resources/views/vendor/package/autocomplete/components using

Structure

Below is the structure of how all the components are laid out, so you know which components to customise (if desired)

Default Components

https://github.com/joshhanley/livewire-autocomplete/tree/main/resources/views/components

Config

Config can be published using

If you wish to use the global namespace <x-autocomplete> instead of <x-lwa::autocomplete> then you can set 'use_global_namespace' => true, in your config.

Default Config

https://github.com/joshhanley/livewire-autocomplete/blob/main/config/autocomplete.php

Styles

The default styles on this component use Tailwind, but they can be overridden by:

Scripts

Livewire Autocomplete scripts are automatically included whenever you have an <x-autocomplete> component on the page.

But the scripts don't load, if the autocomplete component isn't displayed on page render.

To get around this, you can disable the inline scripts by setting the config autocomplete.inline-scripts to false.

You can then either include the script in your app.blade.php layout file at the end of the body tag, after Livewire's scripts.

Or you can include the autocomplete scripts in your app.js bundle.


All versions of livewire-autocomplete with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laravel/framework Version ^10.0|^11.0|dev-master
livewire/livewire Version ^3.0|dev-main
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package joshhanley/livewire-autocomplete contains the following files

Loading the files please wait ....