Download the PHP package synergitech/laravel-typesense-tools without Composer

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

Laravel Typesense Tools

This package adds Artisan commands that help manage Typesense Collections and Collection Aliases in Laravel applications using Laravel Scout.

Using Typesense with Scout requires you to define the schema in the Scout config file so we change the expected functions to static to reduce duplication. This means that the functions cannot reference app() or config() because they're executed too early in the booting process.

We make use of Typesense Collection Aliases so that schema changes can be gracefully deployed to our frontends without causing issues.

See the full examples in examples/config/scout.php.

Requirements

Installation

Usage

Our environments typically have separated application/frontend and worker contexts and we also usually run a separate CLI context. The deployment runbook is usually as follows.

  1. deploy new code to the CLI and run any migrations
  2. deploy new code to the workers with an updated TYPESENSE_VERSION_SUFFIX. We typically use a date for the suffix for easy versioning, i.e. 20260325.
  3. run php artisan search:setup to populate the new collections
  4. when the queue is empty, the new collection schema fields are now available as search:switch-alias is run as the final queue job
  5. deploy the new code to the frontend so the new fields are in use
  6. (optional) run php artisan search:cleanup to remove the now unused collections and get some memory back

Development

As the frontend is powered by Aliases, you can save yourself a little bit of effort by adding the following to the bottom of your DatabaseSeeder class.

This means that every time you or a colleague are starting from scratch, the Aliases will be created. Scout will automatically create the Collections as part of the new data being added.

If you aren't implicitly creating every Collection during your seeding process, you can swap in search:setup instead and that will make sure all the Collections exist and the Aliases are created.

Command reference

search:setup

Populates all known collections and dispatches a search:switch-alias at the end. If --only-index is provided, it checks each Collection/Alias exists. The check is useful for confirming your schema works and there aren't any errors.

Options:

Examples:

search:switch-alias

Upserts each model's alias (searchableAs) to target the active collection (indexableAs). This is used automatically after a call to search:setup

search:delete-suffix {suffix}

Deletes old collections named as:

Example:

search:cleanup

Finds and optionally deletes collections not currently referenced by any alias.


All versions of laravel-typesense-tools with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version >=10.0
laravel/scout Version >=10.0
typesense/typesense-php Version >=5.1
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 synergitech/laravel-typesense-tools contains the following files

Loading the files please wait ...