Download the PHP package ahuggins/laravel-opensearch without Composer

On this page you can find all versions of the php package ahuggins/laravel-opensearch. 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 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

2017-11-02 21 54 09

WITH OpenSearch

2017-11-02 21 57 50

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

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

AHuggins\OpenSearch\Providers\OpenSearchServiceProvider::class,

Alias

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

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

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

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

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).

search_route

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

query_param

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

description

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

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

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

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

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

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)


All versions of laravel-opensearch with dependencies

PHP Build Version
Package Version
No informations.
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 ahuggins/laravel-opensearch contains the following files

Loading the files please wait ....