Search by

ruvelo / laravel-wiki

francoisbultez

A drop-in wiki for Laravel: Markdown pages, [[wiki links]], backlinks, full revision history with diffs, search, private spaces with page permissions, and AI answers with citations.

Package info

github.com/Ruvelo/laravel-wiki

Homepage

Issues

pkg:composer/ruvelo/laravel-wiki

Statistics

Installs: 126

Dependents: 2

Suggesters: 1

Stars: 0

v1.3.0 2026-12-03 00:18 UTC

This package is auto-updated.

Last update: 2026-12-05 10:17:07 UTC


README

Laravel Wiki: the wiki that lives inside your Laravel app

Live demo     Configuration     Permissions     Ask the wiki     Developer guide     Changelog

Tests Laravel 12 | 13 PHP 8.3+ PHPStan level 8 MIT license

Laravel Wiki

A wiki that lives inside your Laravel app: Markdown pages, [[links]] between them, and the full history of every change.

Quick start

composer require ruvelo/laravel-wiki
php artisan migrate

Then open /wiki. Sign in and click Create “Home” to write the first page.

That's it. Anyone can read the wiki and any signed-in user can edit it; to change that, see Who can edit. It runs on your database and your logins, with no frontend build step and no extra services. Want a look first? Click around the live demo.

What you get

  • Markdown pages, GitHub-style, with an optional table of contents.
  • [[Wiki links]] between pages; links to pages not written yet show in red.
  • A menu on the left and the page outline on the right, like the Laravel docs.
  • Every save kept: history, line-by-line diffs and one-click restore.
  • An editor with a live preview, and no lost edits when two people save at once.
  • Search with highlighted snippets, recent changes, and "what links here".
  • Light and dark mode, readable on a phone.
  • Safe to render: raw HTML is escaped, so editors can't inject scripts.

Optional features

All of these are off by default.

Private spaces and permissions

Keep some pages for members, or for chosen people and roles only. Off by default: everything sits in one public space until you create another one, with php artisan wiki:space create or at /wiki/_/spaces. Details.

Ask the wiki

People ask a question in plain words and get an answer written from the pages they may read, with citations. Uses Claude, or any OpenAI-compatible API. Off until you set WIKI_AI_KEY in .env. Details.

AI agents (MCP server)

Lets Claude, Cursor and other agents search, read and (if you allow it) edit the wiki. Off by default: composer require laravel/mcp and set WIKI_MCP=true. Details.

JSON API for apps

Pages, history and Ask the wiki over JSON, behind Sanctum. Off by default: set WIKI_API=true. Details.

A quick tour

A wiki page with a table of contents, blue links to existing pages and a red link to a page not written yet

Pages link to each other. Write [[Deploy guide]] and it becomes a link. Pages that don't exist yet show in red, an open invitation to whoever knows the answer.

The editor: Markdown on the left, live preview on the right

Edit with a live preview. Markdown on the left, the finished page on the right, updated as you type.

A revision with added lines in green and removed lines in red

Every save is kept. See what changed, who changed it, and put any old version back in one click.

Dark mode Search results with highlighted matches
Light and dark, following each reader's system setting. Search with highlighted snippets; an exact title takes you straight to the page.

Full feature list

  • Markdown, GitHub-style: headings, tables, task lists, fenced code, autolinks and strikethrough. Put [TOC] on its own line to get a table of contents.
  • Wiki links: [[Deploy guide]] or [[Deploy guide|how we ship]]. A link to a page that doesn't exist yet shows in red; for editors it opens the create form with the title filled in.
  • Docs-style layout: a menu on the left, the page in the middle and its outline on the right, like the Laravel docs. The menu is a page called Sidebar that editors maintain: headings become groups, [[links]] become items. Without it, the menu lists every page.
  • What links here: every page lists the pages that link to it.
  • Every save is a revision: browse a page's history, see a line-by-line diff of each change, and restore any old version. A restore is itself a revision, so it can be undone.
  • No lost edits: if someone saves a page while you're editing it, your save is refused rather than overwriting theirs, and your text stays in the editor.
  • Live preview beside the editor, updated as you type.
  • Search across titles and content, with highlighted snippets.
  • Recent changes across the whole wiki.
  • Spaces and permissions: group pages into spaces that are public, for signed-in members, or private. Give users or roles view, edit or admin rights on a space or a single page, from the page itself, an artisan command or PHP. Works with plain Laravel gates and with spatie/laravel-permission roles. Private pages stay hidden everywhere: page lists, search, backlinks, links, history, the API, exports and AI agents.
  • Ask the wiki: a question in plain language, an answer written from the pages you can see, with numbered citations linking to them. Uses Claude by default, or any OpenAI-compatible API (OpenAI, Ollama, vLLM...). Off until you add an API key.
  • Safe to render: raw HTML in the source is escaped and javascript: links are dropped. People with edit rights can't inject scripts.
  • Readable URLs in any language: Café Crème → /wiki/café-crème, 日本語 → /wiki/日本語.
  • Light and dark mode following the system setting, readable at phone width.
  • A knowledge source for AI agents: an optional MCP server lets Claude, Cursor and other agents search, read and ask the wiki, and edit it if you allow, each seeing only what its user may see. Coding agents using Laravel Boost also learn how to use the package correctly.

Who can edit

By default, anyone can read and any signed-in user can edit. To narrow that, define a wiki-edit gate, for example in your AppServiceProvider:

use Illuminate\Support\Facades\Gate;

Gate::define('wiki-edit', fn ($user) => $user->is_admin);

To make the whole wiki private, wrap every route in auth through the config:

'middleware' => ['web', 'auth'],

To make only some pages private, use spaces.

Spaces and permissions

Every page lives in a space. A space is one of:

Visibility Who can read it
public Everyone, guests included. General, the default space, is public.
members Signed-in users
private Only the users and roles you give access to

On top of that, you can give a user or a role an ability on a space (it then covers every page in it) or on a single page:

Ability Lets them
view Read it, even if it is private
edit Read and change it, and create pages in the space
admin All of that, and manage who has access

The rules, in short:

  • Reading: you can read a page if its visibility lets you, or if you, or one of your roles, have been given access to it or to its space.
  • Page visibility can only be stricter than its space. A page in a public space can be made members-only or private; a page in a private space can't be made public.
  • Editing a page in a public or members space works as before: anyone who can read it and passes the wiki-edit gate (any signed-in user if you didn't define one). A private page (in a private space, or made private itself) can only be edited by people given edit or admin. An edit grant also works on its own, even for someone the wiki-edit gate would refuse.
  • Wiki admins see and change everything, spaces and access included. They are the users who pass the wiki-admin gate. Without that gate, nobody is a wiki-wide admin: give admin on a space instead.
// AppServiceProvider::boot()
Gate::define('wiki-admin', fn ($user) => $user->is_admin);

Roles. A grant can name a role (or group, or team: any name). The wiki asks your user model for its roles through a wikiRoles() method if it has one; otherwise, if spatie/laravel-permission is installed, it uses the user's Spatie roles (getRoleNames()); otherwise users have no roles and you grant to users directly.

// app/Models/User.php: only if you don't use spatie/laravel-permission
public function wikiRoles(): array
{
    return $this->teams->pluck('slug')->all();
}

For anything else, implement Ruvelo\Wiki\Access\PermissionResolver (isAdmin($user) and roles($user)) and set wiki.permissions.resolver to your class.

Private means private. A page you can't read answers 404, like a page that doesn't exist. It is left out of page lists, the menu, search, recent changes, history, What links here, the JSON API, the MCP tools, Ask the wiki and wiki:export --as. A [[link]] to it looks like a link to a page not written yet, so even its title doesn't show (the link text is whatever the linking page wrote). One thing does show: since titles are unique across the wiki, creating a page with the same title as a hidden one is refused.

Managing access

In the wiki. Each page has an Access link for its admins: who can see it (as the space, members only, or private) and who has been given access. Each space has the same at /wiki/_/spaces/{space}/access. Wiki admins create spaces at /wiki/_/spaces. Editors pick the space when they create a page, and can move a page to another space they can edit.

From the command line:

php artisan wiki:space create "HR" --visibility=private --description="People matters"
php artisan wiki:space list
php artisan wiki:space update hr --visibility=members
php artisan wiki:space show hr                       # its settings and grants
php artisan wiki:space delete hr                     # only an empty space, never the default one

php artisan wiki:grant hr edit --role=hr-team        # everyone with the hr-team role can edit HR
php artisan wiki:grant hr admin --user=ada@example.com
php artisan wiki:grant "page:Salaries" view --user=7 --user=12
php artisan wiki:grant hr --revoke --role=hr-team

php artisan wiki:move hr "Salaries" "Hiring"         # move pages to a space
php artisan wiki:move hr "Salaries" --visibility=private

Users are given by ID or email. A new grant for the same user or role on the same space or page replaces the old one.

From PHP:

use Ruvelo\Wiki\Models\Page;
use Ruvelo\Wiki\Models\Space;
use Ruvelo\Wiki\Wiki;

$hr = Space::create(['name' => 'HR', 'slug' => 'hr', 'visibility' => Space::PRIVATE]);
Wiki::write('Salaries', $markdown, 'First draft', $user, space: 'hr');

Wiki::grant($hr, 'edit', role: 'hr-team');
Wiki::grant(Wiki::find('Salaries'), 'view', user: $ada);
Wiki::revoke($hr, role: 'hr-team');

Wiki::can($user, 'view', $page);                    // or 'edit', 'admin'; $user may be null for a guest
$user->can('wiki.edit', $page);                     // the same rules as gates: wiki.view, wiki.edit, wiki.admin
Page::query()->visibleTo($user)->matching('deploy')->get();
Wiki::findFor('Salaries', $user);                   // null if missing or hidden from $user

Wiki::find(), Wiki::search() and $page->backlinks() are deliberately unfiltered, for your own trusted code. Before showing results to someone, use Wiki::findFor($title, $user) instead of find(), and add ->visibleTo($user) to the other two.

Ask the wiki (AI answers)

People type a question at /wiki/_/ask (the Ask link in the header), and get an answer written from the wiki, with numbered citations that link to the pages it came from.

How it works: the wiki's own search picks the pages that match the question best, among the pages the person asking may read, then the best passages of those pages go to the language model with the question. Nothing else is sent: no other page, and nothing the person can't see. If no page matches, no request is made at all and the person is told so.

It is off until you add an API key:

WIKI_AI_KEY=sk-ant-...

That's all for Claude (Anthropic), the default: the key is an Anthropic API key. The model is claude-opus-5-5; change it with WIKI_AI_MODEL. If anthropic-ai/sdk (1.16 or later) is installed, the wiki calls Claude through Anthropic's official PHP SDK; otherwise it posts to the Messages API itself, with the key in an x-api-key header. Both go through Laravel's HTTP client. To use an OAuth access token instead of an API key, set WIKI_AI_TOKEN_TYPE=oauth.

composer require anthropic-ai/sdk   # optional

Other providers. Any API compatible with OpenAI's chat completions works: OpenAI, Azure gateways, or a model on your own machine with Ollama, LM Studio or vLLM. Set the model (required) and, if it isn't OpenAI, the address:

WIKI_AI_PROVIDER=openai
WIKI_AI_KEY=ollama                      # your provider's key; any non-empty value for a local server
WIKI_AI_MODEL=llama3.1                  # the model name your provider expects
WIKI_AI_URL=http://localhost:11434/v1   # here Ollama; leave out for OpenAI itself

For anything else, implement Ruvelo\Wiki\Ai\Contracts\LanguageModel (one method: generate(string $system, string $prompt): string) and set WIKI_AI_PROVIDER to the class name.

Searching by meaning (optional). By default passages are found by the words in the question. With embeddings on, the wiki also finds passages that mean the same thing in other words ("money back" finds the refund policy). Anthropic has no embeddings API, so this uses any OpenAI-compatible /embeddings endpoint: OpenAI, Voyage AI or a local Ollama.

WIKI_AI_EMBEDDINGS=true
WIKI_AI_EMBEDDINGS_MODEL=voyage-3.5
WIKI_AI_EMBEDDINGS_URL=https://api.voyageai.com/v1
WIKI_AI_EMBEDDINGS_KEY=pa-...   # defaults to WIKI_AI_KEY

Then index the existing pages once: php artisan wiki:embed. Pages are re-indexed as they are saved. Vectors are stored in {prefix}chunks and compared in PHP, which suits wikis of up to a few thousand passages. For your own embedder, implement Ruvelo\Wiki\Ai\Contracts\Embedder.

Who can ask. Signed-in users, on the web, in the API and over MCP. Set wiki.ai.allow_guests to true to let guests ask too (about public pages only); remember each question costs an API call. Asking is rate-limited by wiki.ai.middleware (throttle:20,1 by default).

From PHP:

use Ruvelo\Wiki\Ai\AiException;
use Ruvelo\Wiki\Wiki;

try {
    $answer = Wiki::ask('How long do customers have to ask for a refund?', $user);

    $answer->text;       // Markdown, with [1], [2] where it cites sources
    $answer->citations;  // [['n' => 1, 'title' => 'Refund policy', 'slug' => 'refund-policy', 'url' => '...'], ...]
    $answer->sources;    // every page the model was shown, numbered the same way
    $answer->answered;   // false when no page matched and nothing was asked
} catch (AiException $e) {
    $e->getMessage();    // not configured, the provider failed, or the model declined; safe to show
}

In your tests, Http::fake() covers both built-in providers, the SDK included.

The JSON API has POST /api/wiki/ask and the MCP server an ask_wiki tool, both answering from what the caller may read.

Use it from AI agents

The wiki can be a knowledge source for AI agents: Claude Code, Claude Desktop, Cursor, ChatGPT or anything else that speaks the Model Context Protocol. Ask "how do refunds work?" and the agent searches the wiki, reads the right pages and cites them. (This is separate from Ask the wiki: here the agent's own model does the answering.)

It's built on Laravel MCP, which the wiki suggests but doesn't require. To turn it on:

composer require laravel/mcp
WIKI_MCP=true

Agents get these tools:

Tool Does
search_pages Search titles and text: titles, slugs, spaces, a snippet around the match, URLs
read_page One page by slug or title: Markdown body, title, space, URL, last update, current revision, the pages it links to and the pages linking to it
list_pages Pages alphabetically, paginated; optionally one space
recent_changes The latest edits with their summaries and authors, for the whole wiki or one page
ask_wiki A plain-language question answered from the wiki with citations. Only when Ask the wiki is set up
write_page Create or update a page with an edit summary (and, for a new page, a space). Only when you allow writes (below)

Every page is also a resource, wiki://pages/{slug}, with slug completion, so clients that let you attach resources can pull a page into the conversation.

Who can see what. The endpoint is /mcp/wiki, behind auth:sanctum by default (set wiki.mcp.middleware for another guard). Every tool and resource acts as the token's user and sees exactly what that user sees on the web: private pages they can't read don't appear in results, links or backlinks, and reading one answers as if it didn't exist. The local server acts as WIKI_MCP_USER, or as a guest (public pages only). If your web wiki is wrapped in auth, keep the MCP guard at least as strict.

Writing is off by default. Set WIKI_MCP_WRITES=true to offer write_page. Agents then edit like people do: they need a signed-in user with edit rights on the page (or, for a new page, on its space), each save is a revision with a summary (so it can be diffed and undone in the history), and an update must name the revision it was based on. If someone saved the page in the meantime, the write is refused and the agent is told to read it again and merge. An agent can't overwrite a page it hasn't read.

Connect a client

Create a token for the user the agent acts as (with Sanctum: $user->createToken('wiki-mcp')->plainTextToken), then:

Claude Code

claude mcp add --transport http wiki https://example.com/mcp/wiki --header "Authorization: Bearer YOUR_TOKEN"

Cursor (.cursor/mcp.json)

{
  "mcpServers": {
    "wiki": {
      "url": "https://example.com/mcp/wiki",
      "headers": { "Authorization": "Bearer YOUR_TOKEN" }
    }
  }
}

Claude Desktop (claude_desktop_config.json), through the mcp-remote bridge:

{
  "mcpServers": {
    "wiki": {
      "command": "npx",
      "args": ["mcp-remote", "https://example.com/mcp/wiki", "--header", "Authorization:${WIKI_AUTH}"],
      "env": { "WIKI_AUTH": "Bearer YOUR_TOKEN" }
    }
  }
}

On your own machine, skip the token: run the server over stdio from your app's folder. Set WIKI_MCP_USER to a user id if the agent should be able to write as that user.

claude mcp add wiki -- php /path/to/your-app/artisan mcp:start wiki
{
  "mcpServers": {
    "wiki": { "command": "php", "args": ["/path/to/your-app/artisan", "mcp:start", "wiki"] }
  }
}

Clients that only sign in with OAuth (ChatGPT, Claude.ai connectors) need Laravel Passport: follow the Laravel MCP OAuth guide, then set wiki.mcp.middleware to ['auth:api'].

To mount the server yourself instead (another path, extra middleware), leave WIKI_MCP off and register Ruvelo\Wiki\Mcp\WikiServer in routes/ai.php:

Mcp::web('/mcp/handbook', \Ruvelo\Wiki\Mcp\WikiServer::class)->middleware(['auth:sanctum', 'throttle:60,1']);

Laravel Boost

If your app uses Laravel Boost, php artisan boost:install (or boost:update --discover) picks up the wiki's guidelines, so your coding agent knows to write pages through Wiki::write() rather than the tables, to render with $page->html(), to use the factory in tests, and so on.

Making it look like your app

The views are plain Blade with the styles inlined in one layout. Publish them and edit as you like:

php artisan vendor:publish --tag=wiki-views

They land in resources/views/vendor/wiki. Every page extends layout.blade.php, so swapping that one file for your own layout is enough to put the wiki inside your app's chrome. Each page fills a content section and a title section. The layout also has a wiki-head stack for extra <head> tags, and colors are CSS variables (--wiki-accent and friends) at the top of the layout.

For developers

PHP API

use Ruvelo\Wiki\Wiki;

$page = Wiki::write('Release notes', $markdown, 'v2.0 notes', $user); // create or update
Wiki::create('Onboarding');                 // throws PageAlreadyExists if taken
Wiki::create('Payroll', $markdown, space: 'hr'); // in a space (the default one otherwise)
Wiki::find('Release notes')?->html();       // by title or slug
Wiki::search('deploy')->visibleTo($user)->limit(5)->get();
Wiki::render('**Markdown** with [[links]]');

// Refuse the save if someone else saved since revision 41
$page->commit($title, $body, 'Fix typo', $user, basedOn: 41);

Wiki::write() takes the same basedOn: and throws EditConflict rather than overwrite a newer save.

Access: Wiki::can(), Wiki::grant(), Wiki::revoke(), Wiki::findFor() and the visibleTo($user) query scope (Spaces and permissions). AI: Wiki::ask() and Wiki::aiEnabled() (Ask the wiki).

Events: PageSaved (with wasCreated()) and PageDeleted. Exceptions: EditConflict, PageAlreadyExists, InvalidTitle and Ai\AiException, all extending WikiException.

JSON API

Off by default. Set WIKI_API=true and you get /api/wiki/pages (list, search, show, create, update, delete), /api/wiki/pages/{slug}/revisions (list, show, restore) and /api/wiki/ask, protected by Sanctum. Updates take a base_revision and answer 409 rather than overwrite a newer save. Every request sees only what its user may see: a hidden page answers 404.

Request Does
GET /pages?q=&space= List pages, or search them, optionally in one space. Paginated, per_page up to 100
GET /pages/{slug} One page with space, body, html, revision, links and backlinks
POST /pages Create, with an optional space slug. 201, 409 if the title is taken, 422 if you can't add pages to the space
PATCH /pages/{slug} Update title and/or body; send base_revision to get a 409 instead of overwriting a newer save
DELETE /pages/{slug} Delete the page and its history. 204
GET /pages/{slug}/revisions History, newest first
GET /pages/{slug}/revisions/{id} One revision with its body
POST /pages/{slug}/revisions/{id}/restore Put that version back
POST /ask {question} in, {answer, answered, citations, sources} out. 503 when Ask the wiki isn't set up

Reading needs a valid token; writing also needs edit rights on the page or space. Use your own guard by setting wiki.api.middleware.

Import and export

php artisan wiki:import ~/obsidian-vault --user=1   # also docs/ folders and GitHub wikis
php artisan wiki:import ~/hr-docs --space=hr          # new pages go to the hr space
php artisan wiki:export storage/wiki                 # one .md per page, with front matter
php artisan wiki:export ~/for-ada --as=ada@example.com   # only what Ada may read
php artisan wiki:export ~/hr-backup --space=hr

The export runs as you, on your server, so it includes every page unless you pass --as. Each file's front matter records its space, which an import honours (unless --space says otherwise). Re-importing only saves files that changed. [[links]], [[Page|label]] and [[Page#Section]] work as in Obsidian.

Extending Markdown

// config/wiki.php: 'markdown' => ['extensions' => [FootnoteExtension::class]]
Wiki::extendMarkdown(fn (Environment $env) => $env->addExtension(new MentionExtension));

In your tests

Page::factory()->linkingTo('Deploy guide')->create(); // with a revision and indexed links

URLs

/wiki Home page
/wiki/{slug} A page
/wiki/{slug}/edit Edit
/wiki/{slug}/history Revisions
/wiki/{slug}/history/{id} One revision and its diff
/wiki/{slug}/access Who can see and edit the page (its admins)
/wiki/_/new Create (?title= and ?space= to pre-fill)
/wiki/_/pages All pages
/wiki/_/recent Recent changes
/wiki/_/search?q= Search
/wiki/_/ask Ask the wiki
/wiki/_/spaces All spaces (wiki admins create them here)
/wiki/_/spaces/{space} A space's pages
/wiki/_/spaces/{space}/access A space's settings and access (its admins)

Special pages live under /_/, which can never collide with a page: slugs never contain an underscore.

Renaming a page keeps its address. Links written with the old title ([[Old title]]) still resolve, because they point at the slug.

Requirements

Laravel PHP Tested in CI
12 (12.4.1+; 12.41.1+ for the MCP server, which laravel/mcp requires) 8.3, 8.4, 8.5 yes, from 12.41.1 (CI installs laravel/mcp)
13 8.3, 8.4, 8.5 yes
  • Any database Laravel supports (tested on SQLite; plain SQL that also suits MySQL, MariaDB and Postgres)
  • Optional: laravel/mcp for the MCP server; an API key from Anthropic (or an OpenAI-compatible provider) for Ask the wiki, and anthropic-ai/sdk 1.16+ if you want the wiki to call Claude through Anthropic's official PHP SDK (without it, plain HTTP)

Configuration reference

Publish the config file if you want to change the defaults:

php artisan vendor:publish --tag=wiki-config
Key Default
name Wiki (WIKI_NAME) Shown in the header and page titles
path wiki (WIKI_PATH) URL prefix
domain null Serve the wiki on its own (sub)domain
middleware ['web'] Applied to every route
edit_middleware [] Extra middleware for create/edit/delete/restore (signing in is always required)
home home Slug shown at the wiki root
sidebar sidebar Slug of the page used as the left menu; null for an automatic list
table_prefix wiki_ Tables are {prefix}pages, revisions, links, spaces, grants and chunks
run_migrations true Set to false if you publish and manage the migration yourself
user_model your users provider model Who revisions are attributed to
user_name_attribute name Shown as the author in the history
per_page 50 Page size for lists and search
routes true Set to false to register routes yourself (copy routes/web.php)
api.enabled false (WIKI_API) Turn on the JSON API
api.prefix api/wiki Where the JSON API lives
api.middleware ['api', 'auth:sanctum'] Applied to every API route
mcp.enabled false (WIKI_MCP) Turn on the MCP server for AI agents (needs laravel/mcp)
mcp.path mcp/wiki The MCP HTTP endpoint; null for none
mcp.middleware ['auth:sanctum'] Applied to the MCP endpoint. Use a token guard: agents can't hold a session
mcp.local wiki Handle for php artisan mcp:start wiki; null for none
mcp.local_user null (WIKI_MCP_USER) User id the local server acts as; a guest otherwise
mcp.allow_writes false (WIKI_MCP_WRITES) Offer the write_page tool (still needs edit rights on the page or space)
markdown.extensions [] Extra CommonMark extensions
markdown.options [] CommonMark options, merged over the defaults
spaces.default general Slug of the space new pages go to (created on first use)
spaces.default_name General Its name, when the wiki creates it
permissions.resolver DefaultPermissionResolver Who is an admin and which roles a user has (see Spaces and permissions)
ai.enabled true (WIKI_AI) Master switch: false turns Ask the wiki off even with a key
ai.provider anthropic (WIKI_AI_PROVIDER) anthropic, openai (any OpenAI-compatible API) or your LanguageModel class
ai.api_key null (WIKI_AI_KEY) Turns Ask the wiki on
ai.token_type api_key (WIKI_AI_TOKEN_TYPE) Anthropic: api_key (an API key, sent as x-api-key) or oauth (an OAuth access token, sent as a Bearer token with the OAuth beta header)
ai.model null (WIKI_AI_MODEL) claude-opus-5-5 for Anthropic when empty; required for openai
ai.base_url null (WIKI_AI_URL) The provider's address: https://api.anthropic.com or https://api.openai.com/v1 when empty
ai.max_tokens 16000 Anthropic: the most the model may write, thinking included
ai.timeout 120 Seconds to wait for the provider
ai.effort medium (WIKI_AI_EFFORT) Anthropic: low, medium, high, xhigh or max; null for the model's default
ai.fallbacks true Anthropic: if the model declines a question, let Anthropic retry it on its default substitute model
ai.max_pages 5 Pages the answer may draw on
ai.max_chunks 8 Passages sent to the model
ai.chunk_chars 1500 Passage length: pages are split by headings, then by paragraphs
ai.max_context_chars 24000 Most characters of wiki text in one question
ai.allow_guests false Let guests ask (about public pages)
ai.middleware ['throttle:20,1'] Applied to asking, on the web and in the API
ai.embeddings.enabled false (WIKI_AI_EMBEDDINGS) Also find passages by meaning
ai.embeddings.provider openai (WIKI_AI_EMBEDDINGS_PROVIDER) Any OpenAI-compatible /embeddings API, or your Embedder class
ai.embeddings.api_key null (WIKI_AI_EMBEDDINGS_KEY) Defaults to ai.api_key
ai.embeddings.model null (WIKI_AI_EMBEDDINGS_MODEL) Required with embeddings on
ai.embeddings.base_url https://api.openai.com/v1 (WIKI_AI_EMBEDDINGS_URL) e.g. https://api.voyageai.com/v1 or http://localhost:11434/v1

Upgrading from 1.x

Nothing changes until you configure it. Run the new migration:

php artisan migrate

It only adds things: a {prefix}spaces table with one public space, General (slug general), a space_id and visibility column on pages, and {prefix}grants and {prefix}chunks tables. Every existing page goes into General, so it stays visible to everyone and editable by the same people as before. Your wiki-edit gate keeps working as it did.

If you set run_migrations to false and published the migrations, publish again to get the new one, then migrate:

php artisan vendor:publish --tag=wiki-migrations
php artisan migrate

If you published the views, publish them again (or compare): the layout gained a space menu and an Ask link, and there are new views for spaces, access and Ask the wiki.

Small visible additions: API and MCP page summaries gain a space field, and the header shows a Spaces menu once there is more than one space.

Contributing

Pull requests are welcome. Clone, composer install, then composer check runs code style (Pint), static analysis (PHPStan level 8) and the tests, exactly as CI does. See CONTRIBUTING.md and the changelog.

The demo and screenshots are built from the package itself: composer demo writes the static demo into build/, and demo/screenshots.sh regenerates art/.

Credits

Built by François Bultez at Valtry, the website security scanner, and everyone who contributes.

License

MIT. See LICENSE.