Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Distribution archive exclusions
/tests export-ignore
/.github export-ignore
/bench.php export-ignore
phpstan*.neon export-ignore
phpunit.xml export-ignore
pint.json export-ignore
.env.example export-ignore
CHANGELOG.md export-ignore

# laravel default
*.css linguist-vendored
*.less linguist-vendored
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI
on: [pull_request]
jobs:
tests:
name: Searchable (PHP ${{ matrix.php-versions }} / ORC ${{ matrix.orchestra-versions }} )
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.1', '8.2', '8.3', '8.4' ]
orchestra-versions: [ '8.0', '9.0', '10.0' ]
exclude:
- php-versions: 8.1
orchestra-versions: 9.0
- php-versions: 8.1
orchestra-versions: 10.0
- php-versions: 8.4
orchestra-versions: 8.0
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, gmp, bcmath

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Remove composer.lock
run: rm -f composer.lock

- name: Remove QA dependencies
run: composer remove laravel/pint phpstan/phpstan --dev --no-update

- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Test with phpunit
run: composer test
56 changes: 56 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: QA
on:
push:
branches:
- main
pull_request:
types: [ opened, synchronize ]
jobs:
tests:
name: Searchable QA
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
extensions: mbstring, dom, fileinfo, gmp, bcmath
coverage: xdebug

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ hashFiles('**/composer.json') }}
restore-keys: composer-

- name: Remove composer.lock
run: rm -f composer.lock

- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Check code style
run: vendor/bin/pint --ansi --config pint.json --test

- name: PHPStan src
run: composer stan

- name: PHPStan tests
run: composer stan-tests

- name: Compute Coverage
run: vendor/bin/phpunit --colors --coverage-clover ./coverage.xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/vendor
.*.cache
.phpstan
composer.lock
.env
/cov
150 changes: 0 additions & 150 deletions .php-cs-fixer.dist.php

This file was deleted.

24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.0.0] - 2026-02-21

### Added

- Fulltext search for Eloquent models using native database capabilities (`MATCH...AGAINST` on MySQL/MariaDB, `tsvector/tsquery` on PostgreSQL)
- `Searchable` trait and `SearchableInterface` for easy model integration
- `SearchQuery` class for advanced usage (joins, table aliases, custom field names)
- `TermParser` for driver-aware term parsing and content preparation
- Phonetic matching support with pluggable algorithms via `PhoneticInterface` — also provides typo tolerance by matching phonetically similar inputs
- Built-in French phonetic encoders: `Phonetic` (Phonetic Francais) and `Soundex2` — optimized PHP ports from [Talisman](https://github.com/Yomguithereal/talisman)
- `searchable:enable` artisan command to add columns, fulltext indexes, and (re)index data with optimized batch processing
- Automatic setup after migrations via `MigrationsEnded` event listener
- Support for PHP 8.1 - 8.4
- Support for Laravel 10.x, 11.x, and 12.x
- Support for MySQL, MariaDB, and PostgreSQL
Loading