Download the PHP package soraspire/laravel-searchable without Composer

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

Laravel Searchable

A lightweight Laravel package that enables advanced searching & sorting directly from URL query parameters. Designed to let Frontend (FE) fully control search logic without touching Backend code. Supports custom operators such as like, regex, soundex, fulltext, and more.


Requirements

Features

⚡ Fast attribute search with Eloquent

🎛️ Advanced search from request

🔍 Search through single or multiple columns

🔗 Search through (nested) Relationships

📖 Support for Full-Text Search, Soundex Search

↕️ Supports sorting on attributes and first-level relationships

⚙️ Define your own operators

🛡️ Whitelist allowed columns

Installation

You can install the package via composer:

Publish Config

Usage

In your model:

Now you can search with custom operators:

Search directly from URL query params:

In the above query:

title__like=Laravel → find posts with title containing "Laravel"

Search with multiple columns

Search across multiple columns in the same table by passing multiple query conditions.

Search through relationships

Supports searching through relationships (e.g., comments, user). You can combine conditions from both the main model and related models.

FULLTEXT search

Performs a full-text search, allowing more accurate matching across multiple keywords. Works best on columns with a fulltext index.

SOUNDEX (raw operator)

Searches using the SOUNDEX operator, which matches words that sound similar. Useful for names or terms with different spellings but similar pronunciation.

Custom Operators

You can define your own operators inside the config/searchable.php file.

Now you can search using your custom operators:

Supported Query Operators

Operator Type SQL / Pattern Description
eq basic = Equal
not_eq basic != Not equal
lt basic < Less than
lte basic <= Less than or equal
gt basic > Greater than
gte basic >= Greater than or equal
cont like %{val}% Contains
start like {val}% Starts with
end like %{val} Ends with
like like {val} Exact like
in in - Value in list
not_in not_in - Value not in list
between between - Value between two values
not_between not_between - Value not between two values
null null - Is null
not_null not_null - Is not null
present present - Field exists
blank blank - Field is blank
year raw YEAR({col}) = ? Match year
month raw MONTH({col}) = ? Match month
date raw DATE({col}) = ? Match date
before_today raw DATE({col}) < CURDATE() Date before today
after_today raw DATE({col}) > CURDATE() Date after today
today raw DATE({col}) = CURDATE() Today
regexp raw {col} REGEXP ? Match regex
not_regexp raw {col} NOT REGEXP ? Not match regex
soundex raw SOUNDEX({col}) = SOUNDEX(?) Match similar sounding words
fulltext raw MATCH({col}) AGAINST (? IN BOOLEAN MODE) Full-text search

Sorting on attributes

You can sort the result attributes using the order query parameter.

Sorting on first-level relationships

License

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


All versions of laravel-searchable with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
illuminate/support Version >=10.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 soraspire/laravel-searchable contains the following files

Loading the files please wait ...