New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

technote/laravel-search-helper

Search helper for laravel
5,686 2

Larablocks Analysis

technote/laravel-search-helper works with Laravel 4 to 9 (latest release v0.2.28, Jul 13, 2022), all past end of life (the last on Feb 6, 2024): no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 4 to 9, past end of life since Feb 6, 2024
  • No release in the last 12 months (last: Jul 13, 2022)
  • 28 downloads a month (needs 10,000)
  • 2 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Jul 13, 2022.
  • No releases in the last 12 months.
  • First released: Aug 16, 2019.
  • Monthly downloads: 28.
  • 6 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 30, 2026.

Install
composer require technote/laravel-search-helper
Latest Version:v0.2.28
PHP:^7.4|^8.0
Laravel:4 – 9
License:MIT
Last Updated:Jul 22, 2023
Links: GitHub  ·  Packagist
Maintainer: technote

Laravel Search Helper

CI Status codecov CodeFactor License: MIT PHP: >=7.4

Read this in other languages: English, 日本語.

Search helper for Laravel.

Packagist

Table of Contents

Details

Install

composer require technote/laravel-search-helper

Usage

  1. Implement Searchable Contract and Searchable Trait.

  2. Implement setConditions method.

    <?php
    namespace App\Models;
    
    use Eloquent;
    use Illuminate\Database\Eloquent\Builder;
    use Illuminate\Database\Eloquent\Model;
    use Technote\SearchHelper\Models\Contracts\Searchable as SearchableContract;
    use Technote\SearchHelper\Models\Traits\Searchable;
    
    /**
     * Class Item
     * @mixin Eloquent
     */
    class Item extends Model implements SearchableContract
    {
        use Searchable;
    
        /**
         * @var array
         */
        protected $guarded = [
            'id',
        ];
    
        /**
         * @param  Builder  $query
         * @param  array  $conditions
         */
        protected static function setConditions(Builder $query, array $conditions)
        {
            if (! empty($conditions['s'])) {
                collect($conditions['s'])->each(function ($search) use ($query) {
                    $query->where(function ($builder) use ($search) {
                        /** @var Builder $builder */
                        $builder->where('items.name', 'like', "%{$search}%");
                    });
                });
            }
        }
    }
    
  3. Call search method.

    <?php
    use App\Models\Item;
    
    Item::search([
        's' => [
            'test',
        ],
        'ids' => [1, 2, 3],
    ])->get();
    

Author

GitHub (Technote)
Blog

Related Packages

emilmoe/fullsearch

A full page search screen.

1,009 0
simianbv/search

A utility package that works on top of laravel.

7,964 0
custom-d/hashed-search

A hashed search package for adding a searchable hash to your encrypted database...

2,650 3
laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models...

69,265,943 1,682
typesense/laravel-scout-typesense-driver

Laravel Scout Driver for Typesense

768,355 142

Version History

Version Released PHP Laravel License
v0.2.28 ^7.4|^8.0 * MIT
v0.2.27 ^7.4|^8.0 * MIT
v0.2.26 ^7.4|^8.0 * MIT
v0.2.25 ^7.4|^8.0 * MIT
v0.2.24 ^7.4|^8.0 * MIT