Download the PHP package eslam-dev/laravel-searchable without Composer

On this page you can find all versions of the php package eslam-dev/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 Laravel package for dedicated searchable text columns on Eloquent models: automatic fill on save, text cleaning, and MySQL FULLTEXT search.

Latest Version

Features

✅ Migration Macros - Simple searchableColumn() macro for creating LONGTEXT columns with FULLTEXT indexes
✅ Automatic Population - Searchable columns are automatically updated on model save
✅ Text Cleaning - Comprehensive text normalization (HTML stripping, Arabic normalization, diacritic removal)
✅ FULLTEXT Search - Native MySQL FULLTEXT search with natural language mode
✅ Multiple Columns - Support for multiple searchable columns per model
✅ Relationship Support - Extract text from relationships using dot notation
✅ Translatable Fields - Automatic extraction from JSON/translatable fields
✅ Queue Support - Rebuild searchable columns via queue for large datasets
✅ Highly Configurable - Customize cleaning rules, separators, and extraction methods

Requirements

Installation

Install via Composer:

Publish the configuration file:

Quick Start

1. Add Searchable Columns to Migration

2. Add Trait to Model

3. Search Your Data

Advanced Usage

Relationship Fields

Extract text from related models:

Translatable Fields

For models using Spatie's Translatable or JSON fields:

Options:

Custom Cleaning Rules

Override cleaning rules per model:

LIKE Fallback

For cases where FULLTEXT isn't suitable:

Artisan Commands

Rebuild Searchable Columns

Rebuild searchable columns for existing records:

Configuration

The configuration file config/laravel-searchable.php provides extensive customization options:

Text Cleaning Pipeline

The package applies a comprehensive cleaning pipeline:

  1. Strip HTML - Removes all HTML tags
  2. Decode Entities - Converts HTML entities (& → &)
  3. Normalize Arabic - Standardizes Arabic character variants
  4. Remove Diacritics - Strips Arabic tashkeel marks
  5. Convert to Lowercase - Standardizes case for better matching
  6. Remove Symbols - Strips punctuation and special characters
  7. Collapse Whitespace - Normalizes spacing

Performance Optimization

MySQL Configuration

For better Arabic search, configure MySQL:

Then rebuild the FULLTEXT index:

Queue Processing

For large datasets, use queue processing:

Configure chunk size in config/laravel-searchable.php:

Eager Loading

The package automatically eager loads relationships used in searchable columns to prevent N+1 queries.

Testing

The package includes comprehensive unit and feature tests:

Test Requirements

Tests require a MySQL database. Configure in phpunit.xml:

Examples

E-commerce Product Search

Multi-language Content

Selective Searchable Columns

Troubleshooting

FULLTEXT Search Not Working

  1. Ensure you're using MySQL 5.6+ or MariaDB 10.0+
  2. Check that FULLTEXT indexes are created:

  3. Verify minimum word length matches your content:

Arabic Search Issues

  1. Set ft_min_word_length = 3 in MySQL configuration
  2. Rebuild FULLTEXT indexes: OPTIMIZE TABLE products;
  3. Verify Arabic normalization is enabled in config

Performance Issues

  1. Use queue processing for bulk rebuilds
  2. Adjust chunk size in configuration
  3. Add database indexes on frequently filtered columns
  4. Consider using Laravel Scout for more advanced search needs

Security

If you discover any security-related issues, please open a private security advisory on the repository instead of using the public issue tracker.

License

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

Credits

Support


All versions of laravel-searchable with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^12.0|^13.0
illuminate/database Version ^12.0|^13.0
illuminate/console Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.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 eslam-dev/laravel-searchable contains the following files

Loading the files please wait ...