Download the PHP package matheusmarnt/scoutify without Composer

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

Latest Version on Packagist Tests Code Style Total Downloads Laravel Livewire Scout Docs

Scoutify

⌘K global search modal for Laravel — multi-model Livewire UI powered by Scout.

📘 Documentation: https://matheusmarnt.github.io/scoutify/

Drops a production-ready ⌘K search experience into any Laravel application. Register Eloquent models, choose a Scout driver, and ship a keyboard-triggered modal that queries multiple model types simultaneously, groups results by type, and persists recent search history to session.

Features

Quick Start

This will:

  1. Prompt for a Scout driver (meilisearch, algolia, or typesense)
  2. Install the driver's Composer packages
  3. Publish config/scoutify.php and config/scout.php
  4. Set SCOUT_DRIVER in .env

Registering Models

Make your Eloquent models globally searchable:

The command discovers Eloquent models under app/Models/, prompts you to pick which to register (or pass --all), and automatically edits each chosen model file to:

  1. Import Matheusmarnt\Scoutify\Concerns\Searchable and Matheusmarnt\Scoutify\Contracts\GloballySearchable
  2. Add implements GloballySearchable to the class declaration
  3. Insert use Searchable; as the first statement in the class body

The command then rebuilds the type manifest so models appear in the UI immediately.

The Searchable trait provides sensible defaults for every interface method. Override as needed:

Icon packs: globalSearchIcon() accepts any icon name supported by Blade Icons. Fully-qualified names are auto-detected by matching against all packs registered via Composer service providers — not just those declared in config/blade-icons.php. Install any pack and use its prefix directly:

Short names (e.g. user) get the registered prefix prepended (heroicon-o- by default). Override in a service provider:

globalSearchSubtitle() auto-discovery: if your model has a description, subtitle, excerpt, summary, bio, or body attribute, the trait returns it automatically — HTML is sanitized to plain text (tags stripped, entities decoded, whitespace collapsed) then truncated to 150 chars. Override only when you need custom logic or a different field.

Use --dry-run to preview edits without touching files:

Then import your models into the Scout index:

Add to your layout:

Modal placement: <livewire:scoutify::modal /> must live at the root of your layout, outside any collapsible or conditionally-rendered container (sidebar, drawer, off-canvas nav, etc.). Livewire does not initialise components inside collapsed containers — placing the modal inside a collapsed sidebar means it will not mount until the sidebar is opened, causing the trigger to appear broken. The trigger component (<x-scoutify::gs.trigger />) can go anywhere.

Customizing the Scout Query

Override globalSearchBuilder() on any model to apply custom filters, scopes, or driver-specific options:

Meilisearch note: Meilisearch uses word-boundary prefix search. Substrings that are not word-prefixes (e.g. "ano" inside "Mariano") return no results. If you need substring (infix) matching, override globalSearchBuilder() to configure Meilisearch's attributesToSearchOn or switch to the database driver which uses LIKE-based search.

Opening the Modal Programmatically

Any element can open Scoutify without the official trigger component.

Alpine (recommended):

Plain JS / any context:

Inside a Livewire component:

Do not use wire:click="$dispatch('scoutify:open')" on plain Blade elements — outside a Livewire component tree, Livewire.js never initialises those directives.

Visibility Gating (Authorization)

By default, Scoutify is secure-by-default:

To customize this behavior per model, implement the HasGlobalSearchVisibility contract and use the fluent VisibilityRule builder:

Supported Rules

Rule Description
->visibleToGuests() Allows guests to see results from this model.
->policy(ability, ...args) Checks Gate::check(ability, $record, ...args).
->permission(name) Checks Spatie hasPermissionTo(). Supports array for multiple.
->role(name) Checks Spatie hasRole(). Supports array for multiple.
->attribute(name, expected) Compares $record->name with expected (default true).
->using(Closure) Custom logic: fn($record, $user) => bool.

Use ->mode(VisibilityMode::All) to require all rules to pass (logical AND) instead of any (logical OR).

Spatie Integration: ->permission() and ->role() require spatie/laravel-permission. Scoutify detects it automatically and fails closed if the package is missing when these rules are used.

Global Configuration

Customize the default behavior in config/scoutify.php:

File Preview & Download

Any model can expose an inline file preview pane inside the search modal by implementing HasGlobalSearchPreview:

How it works

Download

Implement the download by listening to the scoutify:download browser event:

PreviewDto reference

Factory method When to use
PreviewDto::fromDisk(disk, path, ...) File lives on a Laravel filesystem disk
PreviewDto::fromUrl(url, ...) File is already a publicly-accessible URL

Optional parameters: mime, filename, sizeBytes, view (custom Blade view), ttl (signed URL TTL in seconds, default 3600).

Commands

Command Description
scoutify:install Install driver packages, publish config, configure backend
scoutify:doctor Verify driver config and backend connectivity
scoutify:searchable Register models as globally searchable and rebuild manifest
scoutify:rebuild Rebuild the type manifest from app/Models/
scoutify:import Import registered models into Scout index
scoutify:flush Flush registered models from Scout index
scoutify:sync Flush then re-import

AI Assistance

Scoutify ships a two-tier AI documentation mechanism so any AI assistant can access current, version-pinned documentation and scaffold correct PHP code.

Layer 1 — static files (any AI client, zero install):

Layer 2 — MCP server (Claude Code, Cursor, Codex, Gemini, Windsurf, Copilot, Cline):

The MCP server exposes 8 tools: search_docs, get_page, list_pages, get_antipatterns, scaffold_searchable_model, scaffold_visibility_rule, scaffold_theme_config, validate_snippet.

→ Full AI integration guide

Upgrading

Moving from v1.x to v2.x requires updating your composer.json constraint and removing legacy config keys before running composer update. Skipping this order causes a RuntimeException crash in the post-update-cmd step.

→ v1.x → v2.0 upgrade guide

Documentation

Testing

Contributing

Please see CONTRIBUTING for details.

License

MIT — see LICENSE.


All versions of scoutify with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
algolia/algoliasearch-client-php Version ^4.42
blade-ui-kit/blade-heroicons Version ^2.5
blade-ui-kit/blade-icons Version ^1.6
http-interop/http-factory-guzzle Version ^1.2
illuminate/contracts Version ^11.0|^12.0|^13.0
laravel/prompts Version ^0.1|^0.3|^1.0
laravel/scout Version ^11.1|^12.0
livewire/livewire Version ^3.0|^4.0
meilisearch/meilisearch-php Version ^1.16
nikic/php-parser Version ^5.0
spatie/laravel-package-tools Version ^1.16
symfony/yaml Version ^7.0|^8.0
typesense/typesense-php Version ^6.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 matheusmarnt/scoutify contains the following files

Loading the files please wait ...