Laravel EnsoLaravel Enso
Guide
Back End
Front End
GitHub
Guide
Back End
Front End
GitHub
  • Back End

    • Action Logger
    • Addresses
    • Algolia
    • Algolia Webshop
    • API
    • Audits
    • Avatars
    • Cache Chain
    • Calendar
    • Cargo Partner
    • Categories
    • Charts
    • CI/CD
    • Cli
    • CNP Validator
    • Comments
    • Commercial
    • Companies
    • Core
    • Countries
    • Currencies
    • Data Export
    • Data Import
    • Discounts
    • Documents
    • Dynamic Methods
    • EAV
    • Emag
    • Enums
    • Excel
    • Facebook
    • Files
    • Filters
    • Financials
    • Forms
    • Frisbo
    • Google
    • Helpers
    • Holidays
    • How-to
    • Image Transformer
    • Impersonate
    • Interactions
    • Inventory
    • IO
    • Localisation
    • Lockable Models
    • Logs
    • Measurement Units
    • Meili Search
    • Meili Search Webshop
    • Menus
    • Migrator
    • Monitored Emails
    • Notifications
    • Packaging Units
    • PDF
    • People
    • Permissions
    • Product Eav
    • Product Lots
    • Products
    • Questionnaires
    • Rememberable
    • Roles
    • Sale Channels
    • Searchable
    • Select
    • Sentry
    • Services
    • Smart Bill
    • Sms Advert
    • Stripe
    • Tables
    • Tasks
    • Teams
    • Ticketing
    • Track Who
    • Tutorials
    • Typesense
    • Typesense Webshop
    • Unit Conversion
    • Upgrade
    • UPS
    • User Groups
    • Users
    • Versions
    • Virtual Call Center
    • Vouchers
    • Webshop
    • Webshop Commercial

Searchable

LicenseStableDownloadsPHPIssuesMerge Requests

Description

Searchable provides the global command-palette style search registry used by Laravel Enso.

The package exposes a single search endpoint, a facade-backed registry for searchable models, and a finder service that resolves results according to configured attributes, scopes, permissions, and optional Scout providers.

It is intended for Enso applications that need cross-module quick search with permission-aware routes and grouped results.

Installation

Install the package:

composer require laravel-enso/searchable

Run the package migrations:

php artisan migrate

Optional publishes:

php artisan vendor:publish --tag=searchable-config
php artisan vendor:publish --tag=searchable-factories

Features

  • Global api/core/searchable/index endpoint.
  • Facade-backed searchable model registry.
  • Finder service that supports local query matching or Scout search providers.
  • Permission-filtered route actions based on the authenticated user's role.
  • Support for route params, custom labels, scopes, permission groups, and nested relation attributes.

Usage

Register searchable models from any package by extending the package search service provider:

public $register = [
    Product::class => [
        'group' => 'Product',
        'attributes' => ['name', 'internal_code', 'part_number'],
        'label' => 'internal_code',
        'permissionGroup' => 'products',
    ],
];

The finder returns grouped results with resolved route params and only the route actions the current user is allowed to execute.

API

HTTP routes

  • GET api/core/searchable/index

Core services

  • LaravelEnso\\Searchable\\Services\\Search
  • LaravelEnso\\Searchable\\Services\\Finder

Behavior:

  • stores registered searchable model definitions
  • executes Scout search when searchProvider is configured
  • otherwise executes filter-based database search
  • filters available actions by role permissions

Depends On

Required Enso packages:

  • laravel-enso/core ↗
  • laravel-enso/filters ↗
  • laravel-enso/migrator ↗
  • laravel-enso/permissions ↗

Contributions

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

Edit this page on GitHub
Last Updated: 4/20/2026, 3:26:25 PM
Prev
Sale Channels
Next
Select