Download the PHP package makidizajnerica/laravel-searcher without Composer

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

Laravel Searcher

Simple model and multi-model search.

Installation

Model Preparation

Model should implement MakiDizajnerica\Searcher\Contracts\Searchable interface, next define attributesForTags() method inside of it. This method should return attribute values that will be used as model tags. After that add MakiDizajnerica\Searcher\Searchable trait.

Tags will be automaticly created on model creation, updated on model updation, and deleted when model is deleted.

If you want to create model without tags you should use createWithoutTags() method:

You can also update model without touching its tags:

When deleting model, you can also disable tags deletion:

Models by default will be grouped by their table name, if you want to change that you can define $searchType property on the model:

Usage

Single Model Search

When searching single model, you can just pass query string to whereTags() scope.

Multiple Model Search

Method's addModel() first parametar is class name of the model that will be searched. The second parametar is the scope, you can pass Closure and array like the example above. You can also pass string which will represent the scope method name:

You may also pass second bool parametar to the search() method, if you want strict searcing. By default its set to false, which means that tags will be search in LIKE clause.

When strict search is set to true, only the models with exact tags will be found.

Return value of the search() method will be MakiDizajnerica\Searcher\Collections\SearchResultCollection instance.

When rendering the search results, you can do something like this:

Property $results will represent array of models that you can loop through.

Author

Nemanja Marijanovic ([email protected])

Licence

Copyright © 2021, Nemanja Marijanovic [email protected]

All rights reserved.

For the full copyright and license information, please view the LICENSE file that was distributed within the source root of this package.


All versions of laravel-searcher with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
laravel/framework Version >=9.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 makidizajnerica/laravel-searcher contains the following files

Loading the files please wait ....