Download the PHP package teamtnt/laravel-scout-tntsearch-driver without Composer

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

TNTSearch Driver for Laravel Scout - Laravel 5.3 - 10

Build Status Quality Score Total Downloads

This package makes it easy to add full text search support to your models with Laravel 5.3 to 9.0.

Premium products

If you find TNT Search to be one of your valuable assets, take a look at one of our premium products

Support us on Open Collective

Contents

Installation

You can install the package via composer:

Add the service provider:

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

Add SCOUT_DRIVER=tntsearch to your .env file

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

In your config/scout.php add:

To prevent your search indexes being commited to your project repository, add the following line to your .gitignore file.

The asYouType option can be set per model basis, see the example below.

Usage

After you have installed scout and the TNTSearch 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:

Then, sync the data with the search service like:

php artisan scout:import App\\Post

If you have a lot of records and want to speed it up you can run (note that with this you can no longer use model-relations in your toSearchableArray()):

php artisan tntsearch:import App\\Post

After that you can search your models with:

Post::search('Bugs Bunny')->get();

Scout status

php artisan scout:status

With this simple command you'll get a quick overview of your search indices.

Image of Scout Status Command

Or you can pass a searchable model argument:

php artisan scout:status "App\Models\Post"

If your models are not in the default location app or one of its subdirectories, you may set the modelPath option

Image of Scout Status Command

Constraints

Additionally to where() statements as conditions, you're able to use Eloquent queries to constrain your search. This allows you to take relationships into account.

If you make use of this, the search command has to be called after all queries have been defined in your controller.

The where() statements you already know can be applied everywhere.

Adding via Query

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

When using constraints apply it after the constraints are added to the query, as seen in the above example.

OrderBy

An orderBy() statement can now be applied to the search query similar to the where() statement.

When using constraints apply it after the constraints are added to the query, as seen in the above example.

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]

Credits

Contributors

This project exists thanks to all the people who contribute.

Backers

Thank you to all our backers! 🙏 [Become a backer]


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

PHP Build Version
Package Version
Requires php Version >=7.1|^8
teamtnt/tntsearch Version 2.7.0|^2.8|^3.0|^4.0
laravel/scout Version 7.*|^8.0|^8.3|^9.0|^10
illuminate/bus Version ~5.4|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/contracts Version ~5.4|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/pagination Version ~5.4|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/queue Version ~5.4|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/support Version ~5.4|^6.0|^7.0|^8.0|^9.0|^10.0|^11.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 teamtnt/laravel-scout-tntsearch-driver contains the following files

Loading the files please wait ....