Download the PHP package tag1/scolta-laravel without Composer

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

Scolta for Laravel

CI

Built and maintained by Tag1 Consulting — technology leadership since 2007.

Laravel 11/12/13 package — Artisan commands, Searchable trait for Eloquent models, and AI-powered search built on Pagefind.

Status

Scolta 1.0 — the API documented here is stable. Breaking changes follow semantic versioning: no removal or signature change without a major version bump and a deprecation cycle. File bugs at the repo issue tracker.

What Is Scolta?

Scolta is a scoring, ranking, and AI layer built on Pagefind. Pagefind is the search engine: it builds a static inverted index at publish time, runs a browser-side WASM search engine, produces word-position data, and generates highlighted excerpts. Scolta takes Pagefind's result set and re-ranks it with configurable boosts — title match weight, content match weight, recency decay curves, and phrase-proximity multipliers. No search server required. Queries resolve in the visitor's browser against a pre-built static index.

This package is the Laravel adapter. It provides Artisan commands for building and maintaining the index, a Searchable trait for Eloquent models, a <x-scolta::search /> Blade component, change tracking via an observer pattern, and REST API endpoints for the AI features. The actual scoring, indexing logic, memory management, and AI communication live in scolta-php, which this package depends on. Scoring runs client-side via the scolta.js browser asset and the pre-built WASM module shipped with scolta-php.

The LLM tier — query expansion, result summarization, follow-up questions — is optional. When enabled, it sends the query text and selected result excerpts to a configured LLM provider (Anthropic, OpenAI, or a self-hosted Ollama endpoint). The base search tier shares nothing with any third party.

Running Example

The examples in this README and the other Scolta repos use a recipe catalog as the concrete data set. Recipes are a good showcase because recipe vocabulary has genuine cross-dialect mismatches:

Here is how to model and index the recipe catalog in Laravel:

Register the model in config/scolta.php:

Build the index:

Then add <x-scolta::search /> to any Blade template and visit the page. A search for aubergine parmesan surfaces Eggplant Parmigiana because the body HTML includes both the American term "eggplant" and the Italian name. Scolta's title boost lifts it above pages that mention aubergine only in passing.

The recipe fixture HTML files live in scolta-php at tests/fixtures/recipes/ if you want a pre-built data set to index without a database.

Quick Install

In .env:

With an API key configured, search queries are automatically expanded with related terms, results include an AI summary, and visitors can ask follow-up questions.

Verify It Works

This verifies PHP version, index directories, indexer selection, AI provider configuration, and binary availability.

The health endpoint also reports current state: GET /api/scolta/v1/health

What Scolta Is Built For

Scolta is designed for content search on Laravel applications: articles, documentation, product catalogs, knowledge bases, and other Eloquent model content indexed at build time. Laravel powers SaaS products, enterprise applications, API platforms, and content-driven sites — and Scolta is tuned for the content search needs of these applications.

The static-index architecture means no Elasticsearch or Solr server to provision. Scolta replaces hosted search SaaS (Algolia, Coveo, SearchStax) and Solr/Elasticsearch backends for Laravel applications where the search use case is full-text relevance, recency, and phrase matching. It runs on managed hosting where binary execution is restricted, using the PHP indexer automatically.

Migrating from Laravel Scout

Scout and Scolta solve different problems. Scout drives external search servers (Algolia, Meilisearch, Typesense). Scolta runs Pagefind, which produces a static browser-side index — no search server required. Scolta then re-ranks Pagefind's results and optionally adds an AI layer.

Replace toSearchArray() with toSearchableContent() and scopeSearch() with scopeSearchable(). Remove Scout from composer.json, publish Scolta's config and migrations, and replace Scout search calls with <x-scolta::search />.

What you gain: no external search service bill, AI query expansion and summarization, works on shared and managed hosting. What you give up: Scout's per-record real-time index updates and its driver flexibility.

Memory and Scale

The default memory profile is conservative, which targets a peak RSS under 96 MB and works on shared hosting with a 128 MB PHP memory_limit. Scolta never silently upgrades to a larger profile.

The admin interface shows the detected PHP memory_limit and suggests a profile. The profile selection is always left to the admin.

Pass the profile via the Artisan CLI:

Available profiles: conservative (default, ≤96 MB), balanced (≤200 MB), aggressive (≤384 MB). Higher budget means fewer, larger index chunks and faster builds.

Or set it in .env:

Tested ceiling at the conservative profile: 50,000 pages. Higher counts likely work; not certified yet.

Deploying to PaaS Platforms

On PaaS platforms — including Laravel Cloud, Forge with push-to-deploy, Vapor, Railway, and Render — the filesystem is rebuilt from your repository on every deploy. Any files written outside the repo at install time are wiped, including assets published by vendor:publish.

php artisan vendor:publish --tag=scolta-assets must run as part of your build pipeline, not just during initial setup.

Wiring it automatically via post-autoload-dump

Add it to your application's composer.json scripts:

Composer runs post-autoload-dump on every composer install and composer update, which PaaS platforms execute automatically on each deploy. The --force flag is required so assets are refreshed even when the destination directory already exists from a previous build cache.

Important: Composer only runs scripts from the root package — your application. Scripts in a dependency's composer.json (including Scolta's own) are never executed for consumers. You must add the script to your own composer.json.

Platform-specific steps

Laravel Cloud: Runs composer install on each deployment. The post-autoload-dump script above runs automatically.

Laravel Vapor: Runs composer install in the Lambda package build step. The post-autoload-dump script above runs automatically.

Laravel Forge (push-to-deploy): Add the publish command to your Forge deployment script, after the composer install line:

AI Features and Privacy

Scolta's AI tier is optional. When enabled:

The base search tier — Pagefind index lookup and Scolta WASM scoring — runs entirely in the visitor's browser with no server-side involvement beyond serving static index files.

Configuration

All settings live in config/scolta.php with .env overrides. After editing config/scolta.php, run php artisan config:clear.

AI Provider

Setting .env key config/scolta.php key Default Description
Provider SCOLTA_AI_PROVIDER ai_provider anthropic anthropic or openai
API key SCOLTA_API_KEY ai_api_key Authentication for AI features
Model SCOLTA_AI_MODEL ai_model claude-sonnet-4-5-20250929 LLM model identifier
Expansion model SCOLTA_EXPANSION_MODEL ai_expansion_model '' (same as ai_model) Optional separate model for query expansion. When set, expand-query uses this model while summarize and followup use ai_model. Empty means all AI operations use ai_model.
Base URL SCOLTA_AI_BASE_URL ai_base_url provider default Custom endpoint for proxies or Azure OpenAI
Query expansion SCOLTA_AI_EXPAND ai_expand_query true Toggle AI query expansion on/off
Summarization SCOLTA_AI_SUMMARIZE ai_summarize true Toggle AI result summarization on/off
Summary top N ai_summary_top_n 10 How many top results to send to AI for summarization
Summary max chars ai_summary_max_chars 4000 Max content characters sent to AI per request
Max follow-ups SCOLTA_MAX_FOLLOWUPS max_follow_ups 3 Follow-up questions allowed per session
AI languages SCOLTA_AI_LANGUAGES ai_languages ['en'] Languages the AI responds in (matches user query language)

In .env:

For multilingual sites:

Search Scoring

Scoring settings live under the scoring key in config/scolta.php.

Setting .env key config/scolta.php path Description
Title match boost scoring.title_match_boost Boost when query terms appear in the title
Title all-terms multiplier scoring.title_all_terms_multiplier Extra multiplier when ALL terms match the title
Content match boost scoring.content_match_boost Boost for query term matches in body/excerpt
Expand primary weight scoring.expand_primary_weight Weight for original query results vs AI-expanded results (higher = original query dominates; raise to 0.7+ if you want literal keyword matches to win)
Recency strategy SCOLTA_RECENCY_STRATEGY scoring.recency_strategy exponential, linear, step, none, or custom
Recency boost max scoring.recency_boost_max Maximum positive boost for very recent content
Recency half-life days scoring.recency_half_life_days Days until recency boost halves
Recency penalty after days scoring.recency_penalty_after_days Age before content gets a penalty (~5 years)
Recency max penalty scoring.recency_max_penalty Maximum negative penalty for very old content
Language SCOLTA_LANGUAGE scoring.language ISO 639-1 code for stop word filtering
Custom stop words scoring.custom_stop_words Extra stop words beyond the language's built-in list
Expansion combine mode SCOLTA_EXPANSION_COMBINE_MODE scoring.expansion_combine_mode How multi-term expansion sub-query results are combined for the AI summary: relevance_union or round_robin. Preset-defaulted in scolta-php (round_robin on the content_catalog/blog/ecommerce presets, relevance_union otherwise); an explicit value overrides the preset

Defaults and the full reference: scolta-php docs/CONFIG_REFERENCE.md.

News site (recency matters a lot):

Documentation site (recency doesn't matter, titles matter a lot):

Recipe catalog (no recency, title precision matters):

Display

Display settings are top-level keys in config/scolta.php.

Setting config/scolta.php key Description
Excerpt length excerpt_length Characters shown in result excerpts
Results per page results_per_page Results shown per page
Max Pagefind results max_pagefind_results Total results fetched from index before scoring
Show attribution show_attribution Render "Powered by Scolta" below the search widget

Defaults and the full reference: scolta-php docs/CONFIG_REFERENCE.md.

Site Identity

Setting .env key config/scolta.php key Default Description
Site name SCOLTA_SITE_NAME site_name app name Included in AI prompts so the AI knows what site it's searching
Site description site_description website Brief description for AI context

Custom Prompts

Override prompts via the top-level keys prompt_expand_query, prompt_summarize, and prompt_follow_up in config/scolta.php, or use an event listener:

Register in EventServiceProvider:

Preset

Getting fewer results than you expect on a recipe, product, or catalog site? Set SCOLTA_PRESET=content_catalog and rebuild your index — the Recipe & Content Catalog preset widens search breadth so ingredient, technique, and product-attribute searches return the fuller set of matches you'd expect.

A preset is the recommended way to tune scoring: pick the one that matches your site instead of setting individual numbers. Set SCOLTA_PRESET in .env (or edit config/scolta.php) to apply one. Any explicit values in the scoring array still override the preset.

Preset Best for
content_catalog Recipe sites, product/content catalogs, wikis
reference Documentation, knowledge bases, encyclopedias
ecommerce Online stores, product catalogs
blog Blogs, news, editorial content
none No preset (default) — all values from the scoring array

For the evidence behind each preset — the scoring sweeps and per-parameter data — see scolta-php's docs/TUNING.md.

Indexer and Memory

Setting .env key config/scolta.php key Default Description
Indexer backend SCOLTA_INDEXER indexer auto auto (always PHP), php, or binary
Memory budget SCOLTA_MEMORY_BUDGET memory_budget.profile conservative conservative, balanced, or aggressive
Chunk size SCOLTA_CHUNK_SIZE memory_budget.chunk_size profile default Pages per chunk during PHP indexer build

Pagefind

Setting .env key config/scolta.php path Default Description
Binary path SCOLTA_PAGEFIND_BINARY pagefind.binary pagefind Path to Pagefind CLI binary
Build dir SCOLTA_BUILD_DIR pagefind.build_dir storage/scolta/build HTML export directory for binary pipeline
Output dir SCOLTA_OUTPUT_DIR pagefind.output_dir public/scolta-pagefind Pagefind index output directory

Caching and Rate Limiting

Setting .env key config/scolta.php key Default Description
Cache TTL SCOLTA_CACHE_TTL cache_ttl 2592000 (30 days) AI response cache TTL in seconds
Rate limit SCOLTA_RATE_LIMIT rate_limit 30 Max API requests per minute per IP

Routes and Middleware

Setting config/scolta.php key Default Description
Route prefix route_prefix api/scolta/v1 Prefix for all Scolta API routes
API middleware middleware ['api'] Middleware for AI API routes
Health middleware health_middleware ['api'] Middleware for the health check endpoint
Amazee route prefix amazee_route_prefix scolta/amazee Prefix for Amazee.ai admin settings routes
Amazee middleware amazee_middleware ['web'] Middleware for Amazee.ai settings routes. With the default, the routes are not registered — set it beyond the bare ['web'] group (e.g. ['web', 'auth']) to enable the admin UI

Auto Rebuild

Setting .env key config/scolta.php key Default Description
Auto rebuild SCOLTA_AUTO_REBUILD auto_rebuild true Dispatch rebuild to queue on content changes
Rebuild delay SCOLTA_AUTO_REBUILD_DELAY auto_rebuild_delay 300 Debounce delay in seconds

Sort and Filter Fields

Setting config/scolta.php key Default Description
Sortable fields sortable_fields [] Field names for data-pagefind-sort attributes
Sort descriptions sortable_field_descriptions [] Human-readable sort field descriptions for LLM
Filter fields filter_fields [] Pagefind filter dimension names
Filter descriptions filter_field_descriptions [] Human-readable filter descriptions for LLM

Amazee.ai Integration

Amazee.ai provides a managed LiteLLM proxy with a free trial. Scolta auto-provisions a trial on the first AI request when no SCOLTA_API_KEY is configured.

CLI provisioning:

Admin UI: The admin settings UI at /scolta/amazee (configurable via amazee_route_prefix) provides the multi-step connection flow. Its routes can disconnect stored AI credentials, so they are disabled by default — they are only registered when you configure amazee_middleware with protection beyond the bare ['web'] group:

With the shipped default (['web']), requests to these routes return 404. CLI provisioning and first-request auto-provisioning work without the admin UI.

Routes (when enabled):

Method Path Description
GET /scolta/amazee Settings page
POST /scolta/amazee/trial Start free trial
POST /scolta/amazee/request-code Request OTP code
POST /scolta/amazee/verify-code Verify OTP code
GET /scolta/amazee/regions List available regions
POST /scolta/amazee/connect Complete connection
DELETE /scolta/amazee/disconnect Disconnect

Migrations

Scolta uses two database tables. Publish and run migrations during installation:

Table Description
scolta_tracker Change tracking for Eloquent models. The ScoltaObserver writes here when models are created, updated, or deleted. Used by incremental builds to process only changed content.
scolta_config Key/value config store for Amazee.ai credentials and auto-configured model settings. Tokens are encrypted via Laravel's Crypt facade.

Debugging

"Pagefind binary not found"

On managed hosting where exec() is disabled, the package falls back to the PHP indexer automatically. The PHP indexer works on WP Engine, Kinsta, Flywheel, Pantheon, and any host where exec() is unavailable. It supports 14 languages via Snowball stemming. The search experience is identical to using the binary.

To install the binary on a host that supports it:

Set SCOLTA_INDEXER=binary in .env and rebuild.

"AI features not working"

  1. Verify API key: php artisan scolta:check-setup
  2. Clear stale cache: php artisan scolta:clear-cache
  3. Clear config cache: php artisan config:clear
  4. Confirm the model name in config/scolta.php

"AI summary says 'I don't have enough context'"

The defaults (10 results, 4000 chars) are already tuned for curation. If still insufficient, increase further:

"AI responses are in the wrong language"

Set ai_languages to match your site's language(s):

"Expanded queries return irrelevant results"

Raise expand_primary_weight (default: 0.5) to make original query terms dominate more, or disable expansion:

"No search results"

  1. Check index status: php artisan scolta:status
  2. Run a full rebuild: php artisan scolta:build
  3. Verify published assets: php artisan vendor:publish --tag=scolta-assets --force
  4. Confirm the Pagefind output directory is web-accessible (must be under public/)

"Models not being indexed"

Run php artisan scolta:discover to find Searchable models not registered in config/scolta.php. The observer only tracks models listed there.

Add the Searchable Trait

Register the model in config/scolta.php:

Artisan Commands

API Endpoints

Method Path Middleware Description
POST /api/scolta/v1/expand-query api, throttle:scolta Expand a search query
POST /api/scolta/v1/summarize api, throttle:scolta Summarize search results
POST /api/scolta/v1/followup api, throttle:scolta Continue a conversation
GET /api/scolta/v1/health api Health check (status only when anonymous)
GET /api/scolta/v1/build-progress api, auth:sanctum Build progress status
POST /api/scolta/v1/rebuild-now api, auth:sanctum Dispatch a rebuild job

Route prefix and middleware are configurable via route_prefix and middleware in config/scolta.php.

The build-progress and rebuild-now endpoints require Sanctum authentication and are intended for admin dashboards. The AI endpoints (expand-query, summarize, followup) use the configurable middleware array and are typically public-facing.

Health detail authorization

GET /api/scolta/v1/health always answers monitoring tools: anonymous requests get {"status": "ok"} (or "degraded"), HTTP 200. The full diagnostic payload (AI provider, index integrity, tracker counts, asset staleness) requires the scolta.health-detail Gate. By default any authenticated user passes. To change who sees the detail, redefine the gate in your AuthServiceProvider:

Note: Amazee.ai admin routes (/scolta/amazee/*) use web middleware and are documented in the Amazee.ai Integration section below.

Searchable Trait API

Method Default Description
toSearchableContent() column heuristic Return a ContentItem for indexing
scopeSearchable($query) all records Filter which records to index
getSearchableType() class name Content type identifier for tracking
shouldBeSearchable() true Whether this instance should be indexed

Optional Upgrades

Upgrade to the Pagefind binary indexer

On hosts with Node.js ≥ 18 or binary execution support, the Pagefind binary is 5–10× faster than the PHP indexer:

Set SCOLTA_INDEXER=binary in .env and rebuild. The PHP indexer continues to work on managed hosts (WP Engine, Kinsta, Pantheon, etc.) where binary execution is disabled.

Keeping the Index Fresh

When auto_rebuild is enabled (SCOLTA_AUTO_REBUILD=true in .env), a ScoltaObserver watches the models listed in config/scolta.php and dispatches a debounced TriggerRebuild job whenever a model is saved or deleted (default delay: 5 minutes). This requires a queue worker running.

Three paths are available, in order of reliability:

Path A: Queue worker / Supervisor (recommended)

Enable auto_rebuild and run a persistent queue worker:

For production, use Supervisor or Laravel Forge to keep the worker running. Forge configures this automatically.

Content saves trigger ScoltaObserver, which dispatches a TriggerRebuild job after the configured delay. The queue worker processes that job in the background.

Path B: Laravel Scheduler

Add a scheduled rebuild to your app. One system cron entry handles all Laravel scheduled tasks:

Then schedule the build in routes/console.php (Laravel 11+):

Or in app/Console/Kernel.php (Laravel 10):

--incremental only processes tracked changes, so runs are fast when nothing has changed.

Path C: System cron (direct)

Call scolta:build directly from system cron, bypassing the Scheduler:

Simpler than the Scheduler but without Laravel's logging integration and overlap protection.

Requirements

The Pagefind binary is optional — the PHP indexer works without it.

Laravel 11 and end-of-life versions

Scolta runs on Laravel 11, 12, and 13, and its test suite covers all three so apps on older releases aren't stranded. Be aware of what that means for Laravel 11 specifically:

Laravel 11 reached end of life on 12 March 2026. The Laravel team no longer ships security patches for it, so advisories against laravel/framework 11.x stay open with no fix. To see which advisories affect the version you're actually running, run composer audit in your project — it reports the affected and fixed version ranges from the same database Scolta's CI uses. The published list is maintained at Laravel's security advisories.

Scolta installs and tests cleanly on Laravel 11 because it deliberately allows these upstream framework advisories in its own CI, which keeps the 11.x compatibility check green. That does not make your application secure — the Laravel version your app runs is your responsibility, and on 11.x you are running an unsupported framework with known, unpatched holes.

If you are on Laravel 11, upgrade to Laravel 12 (security-supported through 24 February 2027) or Laravel 13. If you must stay on 11 for now, treat it as temporary and plan the upgrade.

Testing

Unit tests (no Laravel bootstrap required):

Integration tests (requires DDEV):

Coding standards:

Architecture

This package handles Laravel-specific concerns: Artisan commands, Eloquent model observation, Blade components, route registration, publishable config/migrations, and middleware. It depends on scolta-php and never on scolta-core directly. Scoring runs client-side via WebAssembly loaded by scolta.js.

External Services

Scolta connects to external services under specific conditions. No data is sent automatically — all connections are triggered by developer action or explicit configuration.

GitHub API (api.github.com)

When: A developer runs php artisan scolta:download-pagefind to download the Pagefind binary. What is sent: A standard HTTPS GET request to https://api.github.com/repos/CloudCannon/pagefind/releases/latest. No personally identifiable information is transmitted beyond standard HTTP request headers (IP address, user agent). Service: GitHub, operated by GitHub, Inc. (a subsidiary of Microsoft Corporation). Terms of Service: https://docs.github.com/en/site-policy/github-terms/github-terms-of-service Privacy Statement: https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement

Pagefind Binary (GitHub Releases / Pagefind)

When: php artisan scolta:download-pagefind downloads the Pagefind binary from GitHub Releases after querying the GitHub API above. What is sent: A standard HTTPS GET request to download the release archive. No personally identifiable information is transmitted beyond standard HTTP request headers. Service: Pagefind is an open-source project (MIT license) maintained by the Pagefind project. Pagefind: https://pagefind.app/ CloudCannon: https://cloudcannon.com/ Pagefind License: https://github.com/Pagefind/pagefind/blob/main/LICENSE

AI Provider APIs

When: A visitor performs a search and AI features are enabled (SCOLTA_AI_EXPAND=true or SCOLTA_AI_SUMMARIZE=true in .env). AI features are disabled by default and require an API key to be configured. What is sent: The user's search query text and selected page content excerpts (for result summarization) are sent to the configured AI provider's API endpoint. See AI Features and Privacy for full details on what is and is not transmitted. Providers: The specific provider depends on the SCOLTA_AI_PROVIDER setting:

No AI API calls are made unless SCOLTA_API_KEY is set and AI features are enabled.

About Tag1 Consulting

Scolta is designed, built, and maintained by Tag1 Consulting. Tag1 has been delivering technology leadership since 2007 and is one of the leading open-source consulting firms in the world.

Tag1 offers AI strategy, architecture, and implementation consulting — from evaluating whether AI search is right for your organization, to production deployment and ongoing tuning. If you need help integrating Scolta, customizing scoring for your content model, or connecting it to your AI provider of choice, get in touch.

Credits

Scolta is built on Pagefind by CloudCannon. Without Pagefind, Scolta has no search to score — the index format, WASM search engine, word-position data, and excerpt generation are all Pagefind's. Scolta's contribution is the layer that sits on top: configurable scoring, multi-adapter ranking parity, AI features, and platform glue.

License

MIT

Related Packages


All versions of scolta-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/routing Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
tag1/scolta-php Version ^1.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 tag1/scolta-laravel contains the following files

Loading the files please wait ...