Download the PHP package jonassiewertsen/statamic-live-search without Composer

On this page you can find all versions of the php package jonassiewertsen/statamic-live-search. 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 statamic-live-search

Statamic Live Search

Statamic 3.0+ Latest Version on Packagist

A Statamic Live Search realised with Laravel Livewire.

It's fast to implement, hooks into the Statamic 3 core search and updates search results as you type.

Statamic Live Search

This Package extends my third-party Statamic 3 Livewire integration.

No need for live search?

Check out my Statamic 3 Livewire integration.

Upgrading

Check out the upgrade guide: Upgrade Guide

Installation

Pull in the package with composer

Requirements

Set up Livewire

The option to create your first search provides a quick-start example to get you going.

As the statamic-live-search extends the statamic-livewire addon, the setup is exactly the same and a deeper understanding might be useful. See the link below for more information.

Statamic 3 Livewire integration Docs

Create your first search

Add the livewire:search component to one of your templates and define your template.

Setup the template

Use the default dropdown layout

To get you started as fast as possible, we provide a default template. You can publish it and edit it according to your needs.

After publishing, you will find the template inside resources/views/vendor/live-search/dropdown.blade.php. It can be edited as you like.

Use your own template

Create your own template and put it anywhere you like. Define the template in the tag and you are ready to go.

If you need augmented values - as in the case of images - it's easiest to use Antlers, so you don't need to worry about it.

If the template name is partials.search, the template is expected at resources\views\partials\search.blade.php or resources\views\partials\search.antlers.php.

This might be a solid starting point for your own template:

Blade

Antlers

Configure your index

This is the best bit. This addon hooks into Statamic core search. Just configure your indexes in the config/statamic/search.php file.

If you don't provide an index we will search everything. That's great for smaller sites.

A more specific search could look something like this:

Remember to define the index in your component:

To update your indexes run php please search:update More information

See the Statamic docs for more information

Customize the search logic

The parts we have provided have been built in a modular fashion so you can easily extend them if you wish.

Extend the Search Class

1. Create your own Livewire Controller

php artisan make:livewire YourCustomLivewireController

2. Extend the Search class

2. Use the SearchFacade Controller

It might be that you want to customize the name of the query string or that you want to use multiple filters.

You can import the SearchFacade trait and write a complete Livewire Controller as you need it.

use Jonassiewertsen\LiveSearch\Traits\SearchFacade;

The method we have provided expects the following parameters: search($query, ?string $index = null, ?int $limit = 10)

Have fun customizing.

Upgrade guide

Version 1 to 2

Livewire will be updated to Version 3 under the hood. A full Livewire upgrade guide can be found here: https://livewire.laravel.com/docs/upgrading

Breaking change

Use wire:model.live in your template, instead of wire:model

In Livewire 3, wire:model is "deferred" by default (instead of by wire:model.defer). To achieve the same behavior as wire:model from Livewire 2, you must use wire:model.live.

https://livewire.laravel.com/docs/upgrading#wiremodel

Credits

Thanks to:

Support

I love to share with the community. Nevertheless, it does take a lot of work, time and effort.

Sponsor me on GitHub to support my work and this addon.

License

This plugin is published under the MIT license. Feel free to use it and remember to spread the love.


All versions of statamic-live-search with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0
statamic/cms Version ^4.23.2|^5.0
jonassiewertsen/statamic-livewire Version ^3.0
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 jonassiewertsen/statamic-live-search contains the following files

Loading the files please wait ....