PHPackages                             ahuggins/laravel-opensearch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. ahuggins/laravel-opensearch

ActiveLibrary[Search &amp; Filtering](/categories/search)

ahuggins/laravel-opensearch
===========================

Quickly add the ability for people to search your site in Chrome address bar using OpenSearch. Like when you type an address and press 'space' Chrome searches the site, this package adds that.

0.0.1(8y ago)11151MITPHP

Since Nov 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ahuggins/laravel-opensearch)[ Packagist](https://packagist.org/packages/ahuggins/laravel-opensearch)[ RSS](/packages/ahuggins-laravel-opensearch/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Laravel OpenSearch
==================

[](#laravel-opensearch)

You know when you go to Amazon.com or Google.com, you type in the domain, hit space, and the whole address bar becomes a "search field"? If you have wanted to add that to your site, then this package will make it super easy.

> Note: The "name" of your site, should be set in the `config/app.php` file **BEFORE** you load this package on your site. Google (and other search engines) cache the opensearch.xml file on your site (one of the things provided by this package) pretty aggressively, so it can be a while before it updates.

Without OpenSearch
==================

[](#without-opensearch)

[![2017-11-02 21 54 09](https://user-images.githubusercontent.com/1791228/32358118-8f199dce-c019-11e7-8598-d47e4df4c8b2.gif)](https://user-images.githubusercontent.com/1791228/32358118-8f199dce-c019-11e7-8598-d47e4df4c8b2.gif)

WITH OpenSearch
===============

[](#with-opensearch)

[![2017-11-02 21 57 50](https://user-images.githubusercontent.com/1791228/32358119-8f42627c-c019-11e7-994e-bd88dac032a7.gif)](https://user-images.githubusercontent.com/1791228/32358119-8f42627c-c019-11e7-994e-bd88dac032a7.gif)

> Note: While the "WITH" OpenSearch Gif shows a "Whoops" That is only because my test/example site, does not have a 'search' route. Notice too, that the url does route to the "customizable" search route.

Installation
------------

[](#installation)

This was made after release of 5.5, which is what it was built with, so I'll say it supports Laravel 5.5+, but really it probably is good on Laravel 5+.

`composer require ahuggins/laravel-opensearch`

> Note, since this was made with Laravel 5.5, it supports Package Auto-Discovery, so you should not need to manually add the ServiceProvider or Alias to `config/app.php`. But just in case for the sake of copy/pasta:

#### ServiceProvider

[](#serviceprovider)

`AHuggins\OpenSearch\Providers\OpenSearchServiceProvider::class,`

#### Alias

[](#alias)

`'OpenSearch' => AHuggins\OpenSearch\Facades\OpenSearchFacade::class,`

Remaining Setup
---------------

[](#remaining-setup)

There is a config file you might want to customize, to publish it, you need to do:

`php artisan vendor:publish`

This puts a `opensearch.php` file in your apps `config` folder.

#### Final Piece

[](#final-piece)

In order for this to work, you need to add the following to the `` section of your app layout or your base blade file:

`{!! OpenSearch::load() !!}`

Notes
-----

[](#notes)

This package does not provide a "search" functionality to your site. It just makes adding the Chrome ability to search from the address bar. You will have to connect the route to your search route/view.

You can customize this using the provided config (provided you publish it, see above).

```
// The config options

'search_route' => 'search',
'query_param' => 'q',
'description' => [
    'before_name' => 'Search',
    'after_name' => '',
],
'title' => 'Search Site',
'xml_route' => 'opensearch.xml',
'favicon' => [
    'type' => 'image/x-icon',
    'path' => 'favicon.ico',
]

```

#### `search_route`

[](#search_route)

This is whatever your actual app's search route would be `yoururl.com/{yoursearchroute}`.

#### `query_param`

[](#query_param)

If you use something other than `q` as your query param, designate it here.

#### `description`

[](#description)

This is used to "decorate" the "name" of your site in the search box.

###### `before_name`

[](#before_name)

the Before Name, will be placed before the "name" of your site.

> Note: The "name" of your site, should be set in the `config/app.php` file BEFORE you load this package on your site. Google (and other search engines) cache the opensearch.xml file on your site (one of the things provided by this package) pretty aggressively, so it can be a while before it updates.

###### `after_name`

[](#after_name)

Like Before Name, but this comes "after" the name of your site.

#### `title`

[](#title)

Title is only really used in the output of the link to the `opensearch.xml` file. You can see it in the head section (or wherever you output the `::load()` call). `Search Site` should be a good default for most sites...but if you want to override it. Do so with this option in the `config/opensearch.xml` file.

#### `xml_route`

[](#xml_route)

If for some reason you have a need to change from the default `opensearch.xml` do so here. It's basically what search engines look for for this definition.

#### `favicon`

[](#favicon)

Specify the path to the favicon and the `type` below. `type` is usually going to be `image/x-icon` or `image/png`. Just be sure you have the right type for the right type of favicon.

> Currently this package only supports a single favicon, but this package also accepts Pull Requests! (hint hint)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3113d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d616aab541a2c6c34aba4b6d2b8bfa2f6182a6f3ffd2687dcb731a44a857676a?d=identicon)[ahuggins](/maintainers/ahuggins)

---

Top Contributors

[![ahuggins](https://avatars.githubusercontent.com/u/1791228?v=4)](https://github.com/ahuggins "ahuggins (13 commits)")[![MArmourTCCC](https://avatars.githubusercontent.com/u/115800747?v=4)](https://github.com/MArmourTCCC "MArmourTCCC (1 commits)")

### Embed Badge

![Health badge](/badges/ahuggins-laravel-opensearch/health.svg)

```
[![Health](https://phpackages.com/badges/ahuggins-laravel-opensearch/health.svg)](https://phpackages.com/packages/ahuggins-laravel-opensearch)
```

###  Alternatives

[ruflin/elastica

Elasticsearch Client

2.3k50.4M203](/packages/ruflin-elastica)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M65](/packages/opensearch-project-opensearch-php)[mailerlite/laravel-elasticsearch

An easy way to use the official PHP ElasticSearch client in your Laravel applications.

934529.3k2](/packages/mailerlite-laravel-elasticsearch)[massive/search-bundle

Massive Search Bundle

721.4M13](/packages/massive-search-bundle)[outl1ne/nova-multiselect-filter

Multiselect filter for Laravel Nova.

45802.7k3](/packages/outl1ne-nova-multiselect-filter)[handcraftedinthealps/zendsearch

a general purpose text search engine written entirely in PHP 5

39921.0k35](/packages/handcraftedinthealps-zendsearch)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
