Download the PHP package typesense/laravel-scout-typesense-driver without Composer

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

Laravel Scout Typesense Driver

This package makes it easy to add full text search support to your models with Laravel 7.* to 11.*.

[!IMPORTANT] The features from the Scout driver in this repo have been merged upstream into Laravel Scout natively.

So we've temporarily paused development in this repo and plan to instead address any issues or improvements in the native Laravel Scout driver instead.

If there are any Typesense-specific features that would be hard to implement in Laravel Scout natively (since we need to maintain consistency with all the other drivers), then at that point we plan to add those features into this driver and maintain it as a "Scout Extended Driver" of sorts. But it's too early to tell if we'd want to do this, so we're in a holding pattern on this repo for now.

In the meantime, we recommend switching to the native Laravel Scout driver and report any issues in the Laravel Scout repo.

Contents

Installation

The Typesense PHP SDK uses httplug to interface with various PHP HTTP libraries through a single API.

First, install the correct httplug adapter based on your guzzlehttp/guzzle version. For example, if you're on Laravel 8, which includes Guzzle 7, then run this:

Then install the driver:

And add the service provider:

Ensure you have Laravel Scout as a provider too otherwise you will get an "unresolvable dependency" error

Add SCOUT_DRIVER=typesense to your .env file

Then you should publish scout.php configuration file to your config directory

In your config/scout.php add:

Usage

If you are unfamiliar with Laravel Scout, we suggest reading it's documentation first.

After you have installed scout and the Typesense driver, you need to add the Searchable trait to your models that you want to make searchable. Additionaly, define the fields you want to make searchable by defining the toSearchableArray method on the model and implement TypesenseSearch:

Then, sync the data with the search service like:

php artisan scout:import App\\Models\\Todo

After that you can search your models with:

Todo::search('Test')->get();

Adding via Query

The searchable() method will chunk the results of the query and add the records to your search index. Examples:

Multi Search

You can send multiple search requests in a single HTTP request, using the Multi-Search feature.

Generate Scoped Search Key

You can generate scoped search API keys that have embedded search parameters in them. This is useful in a few different scenarios:

  1. You can index data from multiple users/customers in a single Typesense collection (aka multi-tenancy) and create scoped search keys with embedded filter_by parameters that only allow users access to their own subset of data.
  2. You can embed any search parameters (for eg: exclude_fields or limit_hits) to prevent users from being able to modify it client-side.

When you use these scoped search keys in a search API call, the parameters you embedded in them will be automatically applied by Typesense and users will not be able to override them.

Usage

Migrating from devloopsnet/laravel-typesense

Authors

This package was originally authored by Abdullah Al-Faqeir and his company DevLoops: https://github.com/devloopsnet/laravel-scout-typesense-engine. It has since been adopted into the Typesense Github org.

Other key contributors include:

License

The MIT License (MIT). Please see the License File for more information.


All versions of laravel-scout-typesense-driver with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/scout Version ^8.0|^9.0|^10.0
illuminate/bus Version ^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/contracts Version ^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/database Version ^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/pagination Version ^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/queue Version ^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^7.0|^8.0|^9.0|^10.0|^11.0
typesense/typesense-php Version ^4.2
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 typesense/laravel-scout-typesense-driver contains the following files

Loading the files please wait ....