PHPackages                             searsandrew/series-wiki - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. searsandrew/series-wiki

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

searsandrew/series-wiki
=======================

Series-agnostic wiki backend toolkit for Laravel (spoiler gates, templates, timelines, link suggestions).

v0.1.0(2mo ago)08MITPHPPHP ^8.2CI passing

Since Feb 26Pushed 2mo agoCompare

[ Source](https://github.com/searsandrew/series-wiki)[ Packagist](https://packagist.org/packages/searsandrew/series-wiki)[ RSS](/packages/searsandrew-series-wiki/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

SeriesWiki (Laravel package)
============================

[](#serieswiki-laravel-package)

SeriesWiki is a **series-agnostic, spoiler-safe wiki backend toolkit** for Laravel. It provides a block-based content model with:

- **Spoiler gating** (work/chapter gates) with safe/full block bodies
- **Timeline filtering** (year/era slices) at the block level
- **Variants** (faction/perspective switching) driven by data tables (no hardcoding)
- **Templates** that seed entries with required blocks by entry type (e.g. planet/species/ship)
- **Internal link suggestions** via a crawler + review/apply workflow
- **Search API** backed by crawler snapshots (`safe` and `full` modes)
- **Validation** for entry meta + block payloads (extensible via config)

> This package does **not** include a UI/editor. Your application provides the admin/editor experience.

---

Install
-------

[](#install)

```
composer require searsandrew/series-wiki
```

Publish config + migrations:

```
php artisan vendor:publish --tag=series-wiki-config
php artisan vendor:publish --tag=series-wiki-migrations
php artisan migrate
```

---

Core Concepts
-------------

[](#core-concepts)

- **Series:** A wiki universe / series namespace (e.g. “Stellar Empire”)
- **Entry:** A page/subject (ship/species/planet/event/etc.)
- **Block:** The unit of content for an entry (text/image/chart/map/etc.)
- **Gate:** A spoiler threshold (work + chapter position)
- **TimeSlice:** A year/era/range for timeline filtering
- **Variant:** An alternate view of an entry (often faction-based)
- **Template:** Seeds an entry with a standard set of blocks (by entry type)

---

Rendering (Spoilers + Timeline + Variants)
------------------------------------------

[](#rendering-spoilers--timeline--variants)

Render blocks for an entry using a viewer context:

```
use Searsandrew\SeriesWiki\Services\EntryRenderer;
use Searsandrew\SeriesWiki\Services\Timeline\YearRange;

$renderer = app(EntryRenderer::class);

$blocks = $renderer->renderWithContext(
    $entry,
    auth()->user(),                // or null for guest
    new YearRange(4250, 4250),      // or null for no time filtering
    'republic'                      // variant_key (optional)
);
```

Each item includes:

- display.text (for text blocks)
- display.payload (for non-text blocks)
- is\_locked / locked\_mode

---

Templates: create entry scaffolds by type
-----------------------------------------

[](#templates-create-entry-scaffolds-by-type)

Create a template with `entry_type = 'planet'`, then use your app to create entries of type `planet`. The package will resolve the default template by type and seed the required blocks.

---

Search API (Safe vs Full)
-------------------------

[](#search-api-safe-vs-full)

Search uses crawler snapshots. Query in safe mode for spoiler-safe results (recommended for public):

```
use Searsandrew\SeriesWiki\Services\Search\SearchService;

$results = app(SearchService::class)->search($series, 'Type 88', [
    'mode' => 'safe',   // 'safe' or 'full'
    'type' => 'ship',   // optional entry type filter
    'limit' => 20,
]);
```

Each result includes: entry, score, snippet, mode

---

Crawler: Link Suggestions + Snapshots
-------------------------------------

[](#crawler-link-suggestions--snapshots)

Generate snapshots and link suggestions:

```
  php artisan series-wiki:crawl --series=stellar-empire
```

The crawler creates:

- entry snapshots in `sw_entry_snapshots` (both `safe` and `full` modes)
- suggestions in `sw_link_suggestions` (`new|accepted|dismissed`)

---

Applying suggestions
--------------------

[](#applying-suggestions)

Your app can review suggestions and apply them to blocks using:

- `Searsandrew\SeriesWiki\Services\Crawler\LinkSuggestionWorkflow`

It supports accept/dismiss and applying a suggestion to markdown content.

### URL generation

[](#url-generation)

Markdown URL generation is configurable:

```
    // config/series-wiki.php
    'links' => [
      'url_generator' => function ($entry) {
          return '/wiki/' . $entry->slug;
      },
    ],
```

---

### Validation

[](#validation)

Validation is extensible via config:

- `entries.types.{type}.rules/defaults/fields`
- `blocks.types.{type}.rules/defaults/fields`

Use:

- `Searsandrew\SeriesWiki\Services\Entries\EntryValidator`
- `Searsandrew\SeriesWiki\Services\Blocks\BlockValidator`

---

Tests
-----

[](#tests)

```
    ./vendor/bin/pest
```

License
-------

[](#license)

MIT

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance86

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

74d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a5c84ad1a6d5d04e99f67803bcbb72987ede348a9153bb6b0daf3e3d0e12ed1f?d=identicon)[searsandrew](/maintainers/searsandrew)

---

Top Contributors

[![searsandrew](https://avatars.githubusercontent.com/u/1470088?v=4)](https://github.com/searsandrew "searsandrew (35 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/searsandrew-series-wiki/health.svg)

```
[![Health](https://phpackages.com/badges/searsandrew-series-wiki/health.svg)](https://phpackages.com/packages/searsandrew-series-wiki)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M686](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[kirschbaum-development/commentions

A package to allow you to create comments, tag users and more

12369.2k](/packages/kirschbaum-development-commentions)[wearepixel/laravel-cart

A cart implementation for Laravel

1310.5k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
