PHPackages                             wordvel/wordvel - 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. [Framework](/categories/framework)
4. /
5. wordvel/wordvel

ActiveLibrary[Framework](/categories/framework)

wordvel/wordvel
===============

Proof-of-concept Laravel to embedded WordPress runtime bridge.

10PHP

Since Jun 20Pushed 1mo agoCompare

[ Source](https://github.com/hcuadra811/wordvel)[ Packagist](https://packagist.org/packages/wordvel/wordvel)[ RSS](/packages/wordvel-wordvel/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

WordVel
=======

[](#wordvel)

WordVel lets a Laravel API own application behavior while WordPress owns editing, content storage, media, menus, and the admin experience.

The philosophy is codebase-as-configuration:

- Laravel routes, controllers, Data DTOs, models, enums, and OpenAPI annotations are the source of truth.
- WordPress reads a generated manifest and exposes the Laravel API through its REST surface.
- Editor screens are generated from code contracts by convention first, with attributes used only for unavoidable overrides.
- WordPress should not bypass Laravel API behavior. API bridge routes proxy over HTTP so middleware, routing, validation, route binding, response handling, and application code run normally.

What WordVel Provides
---------------------

[](#what-wordvel-provides)

- `wordvel:install` to publish config, starter routes, starter DTOs/controllers, local WordPress, ReDocly docs, and the WordPress bridge.
- `wordvel:manifest` to generate `storage/wordvel/manifest.json` from routes, blocks, theme options, regions, and resources.
- WordPress bridge plugin assets for Gutenberg blocks, editor previews, admin region pages, resource CRUD screens, and HTTP API route proxying.
- DTO-driven Gutenberg block schemas using `#[AsBlock]` and block field attributes.
- DTO-driven theme option schemas using `#[AsThemeOptions]` and `#[OptionGroup]`.
- DTO-driven resource editor schemas using `#[WordVelResource]`.
- Resource CRUD endpoints under `/api/wordvel/resources`.
- Editor preview sync endpoints under `/api/wordvel/editor-preview`.
- Optional API Kit and OpenAPI generator integration.

Installation
------------

[](#installation)

```
composer require wordvel/wordvel
php artisan wordvel:install
```

With API Kit conventions:

```
composer require wordvel/wordvel langsys/laravel-api-development-kit
php artisan wordvel:install --with-api-kit
```

With OpenAPI docs:

```
composer require langsys/openapi-docs-generator
php artisan openapi:generate
```

Useful options:

```
php artisan wordvel:install --force
php artisan wordvel:install --skip-redocly
php artisan wordvel:install --skip-wordpress
php artisan wordvel:install --wordpress-dir=wordpress
```

After model/resource/route changes:

```
php artisan wordvel:manifest
php artisan openapi:generate
php artisan test
```

Bridge Model
------------

[](#bridge-model)

WordVel exposes Laravel API routes to WordPress by convention.

The generated manifest includes API routes whose URI matches `config('wordvel.bridge.include_prefixes')`, which defaults to `api`. WordPress registers matching REST routes under:

```
/wp-json/{manifest.namespace}/{manifest.prefix}
```

For example:

```
Laravel:   GET http://belle-api.test/api/v1/shop/products/{product}
WordPress: GET http://belle-wp.test/wp-json/wordvel/v1/shop/products/{product}
```

WordPress proxies the request to Laravel over HTTP. It preserves query params, route params, request body, and common headers such as `Accept-Language` and `Authorization`.

Bridge config:

```
'bridge' => [
    'expose_api_routes' => true,
    'api_base_url' => env('WORDVEL_API_URL', env('APP_URL')),
    'include_prefixes' => ['api'],
    'exclude_prefixes' => ['api/internal', 'api/_debug'],
],
```

Use route-level opt-out for rare internal endpoints:

```
Route::get('/internal/report', Controller::class)
    ->withoutWordvelBridge();
```

Use route-level opt-in only when a route lives outside the included API prefixes:

```
Route::get('/custom-public-feed', Controller::class)
    ->wordvelBridge();
```

`responseDto()` is kept as a backward-compatible route macro, but generated WordVel code no longer uses it. OpenAPI generation does not need it, and the WordPress bridge does not need it.

Resource CoC
------------

[](#resource-coc)

A resource DTO is a Spatie Laravel Data class with `#[WordVelResource]`.

```
#[WordVelResource(key: 'shop-products', menuLabel: 'Shop')]
final class ProductResource extends Data
{
    public function __construct(
        public string $id,
        public string $name,
        public string $slug,
        public ProductStatus $status = ProductStatus::Draft,
        public ?string $description = null,
        public int $price_cents = 0,
        public int $created_at = 0,
    ) {}

    public static function fromModel(Product $product): self
    {
        return new self(...);
    }
}
```

WordVel infers:

- Model: from `fromModel(Product $product)`, then from `App\Models\Product`, then from a package namespace like `Wordvel\Shop\Models\Product`.
- Key: from class name, unless `key` is set.
- Label/plural label: from class name, unless set.
- `id`: omitted from WordPress editor by default.
- `*_at`: omitted from WordPress editor by default.
- Computed/unbacked constructor properties: omitted from WordPress editor by default.
- `string`: text field.
- `?string`, defaults, and `Optional`: not required.
- non-null `string` with no default: required.
- `slug`: slug field, generated from `name` when the model has a `name` column.
- names containing `description`, `notes`, `address`, or `reference`: rich text area.
- `int`/`float`: number field.
- `bool`: boolean field.
- backed enum: select field using enum values.
- localized fields: inferred from model casts/DB column type (`array`, `json`, `jsonb`, etc.).
- media fields: inferred from names like `image`, `primary_image`, `featured_image`, `gallery`.
- relationships: inferred from Eloquent relationships and `_id` properties when possible.
- `Collection`: relationship when the model has a matching relation.

Use attributes for exceptions:

- `#[WordVelResource(...)]` for resource-level config such as `key`, menu grouping, ordering, slug prefix, or `includeId`.
- `#[OmitField]` to hide a backed field from the editor.
- `#[IncludeField]` to include fields normally omitted by convention.
- `#[RelationshipField]` when the public property name differs from the Eloquent relation.
- `#[SlugField]` for non-`slug` slug-like fields such as `code`.
- `#[NumberField(readonly: true)]` for computed totals.
- `#[MediaField]` when media column names do not follow convention.

Blocks
------

[](#blocks)

Blocks use `#[AsBlock]`:

```
#[AsBlock('hero', 'Hero')]
final class HeroBlockData extends Data
{
    public function __construct(
        #[Text]
        public string $title,

        #[Image]
        public ?MediaData $image = null,
    ) {}
}
```

Block fields still use explicit block attributes because block schemas are pure editor schemas and do not have an Eloquent model to infer from.

Theme Options
-------------

[](#theme-options)

Theme options use `#[AsThemeOptions]`:

```
#[AsThemeOptions('site', 'Theme Options')]
final class SiteThemeOptionsResource extends Data
{
    public function __construct(
        #[OptionGroup('Brand')]
        public BrandOptionsData $brand,
    ) {}
}
```

WordPress renders the editor from the manifest and stores values in WordPress options.

OpenAPI
-------

[](#openapi)

WordVel expects API apps to use DTOs that can also be scanned by `langsys/openapi-docs-generator`. The OpenAPI generator scans code and annotations; it does not require WordVel bridge route metadata.

Common flow:

```
php artisan openapi:generate
```

Local Development
-----------------

[](#local-development)

Typical loop:

```
php artisan optimize:clear
php artisan wordvel:manifest
php artisan openapi:generate
php artisan test
```

When working on the WordPress bridge, also publish or copy bridge assets into the test app and confirm `/wp-json/wordvel/v1/...` routes proxy to Laravel over HTTP.

###  Health Score

20

—

LowBetter than 12% of packages

Maintenance61

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7b51636a402c8fc758f251e1a92b468a3515a5038a3c278a4499782688b83586?d=identicon)[hcuadra](/maintainers/hcuadra)

---

Top Contributors

[![hcuadra811](https://avatars.githubusercontent.com/u/7507416?v=4)](https://github.com/hcuadra811 "hcuadra811 (7 commits)")

### Embed Badge

![Health badge](/badges/wordvel-wordvel/health.svg)

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

###  Alternatives

[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[alizharb/laravel-modular

A professional, framework-agnostic modular architecture for Laravel 11+. Features zero-config autoloading, 29+ Artisan command overrides, and seamless Vite integration.

211.6k9](/packages/alizharb-laravel-modular)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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