PHPackages                             knowler/wp-capsule - 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. [Database &amp; ORM](/categories/database)
4. /
5. knowler/wp-capsule

ActiveLibrary[Database &amp; ORM](/categories/database)

knowler/wp-capsule
==================

Laravel Illuminate Capsule configured for WordPress.

0.2.0(7y ago)2315MITPHPPHP ^7.1

Since Nov 23Pushed 6y agoCompare

[ Source](https://github.com/knowler/wp-capsule)[ Packagist](https://packagist.org/packages/knowler/wp-capsule)[ RSS](/packages/knowler-wp-capsule/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

WordPress Capsule
=================

[](#wordpress-capsule)

[![Build Status](https://camo.githubusercontent.com/770f30b5ae4a1e8cc9a1897a0018f863e5bc273ed319199d4aebd593285cc90f/68747470733a2f2f7472617669732d63692e6f72672f6b6e6f776c65722f77702d63617073756c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/knowler/wp-capsule)

Illuminate's [Capsule](https://github.com/illuminate/database) preset for WordPress. This is just a wrapper with a config, so kudos to Laravel for being awesome.

**This is *not* a plugin, it's a package for use in a WordPress plugin. Also, note that it presumes that your WordPress site is using [PHP dotenv](https://github.com/vlucas/phpdotenv) under the hood. It works well if you are using [Bedrock](https://github.com/roots/bedrock).**

Requirements
------------

[](#requirements)

- PHP: ^7.1
- [PHP dotenv](https://github.com/vlucas/phpdotenv)

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

[](#installation)

```
composer require knowler/wp-capsule
```

Usage
-----

[](#usage)

Here's example usage within a plugin:

```
/** Autoload */
require_once __DIR__ . '/vendor/autoload.php';

/** Boot Capsule */
new KnowlerKnows\WP\Capsule\Boot;

use KnowlerKnows\WP\Capsule\Capsule;

register_activation_hook(__FILE__, function () {
    Capsule::schema()->create('products', function ($table) {
        $table->increments('id');
        $table->string('name');
        $table->timestamps();
    });
});

register_deactivation_hook(__FILE__, function () {
    Capsule::schema()->dropIfExists('products');
});
```

Contributing
------------

[](#contributing)

Feel free to make a pull request or report issues. I threw this together pretty quickly.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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

Every ~0 days

Total

2

Last Release

2729d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c774e283ba3c7f96d1ac56500b3d5c7e246eb5bd958fe53e3982a1cf899b832?d=identicon)[knowler](/maintainers/knowler)

---

Top Contributors

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

---

Tags

illuminate-databasewordpresslaravelwordpressdatabaseilluminatecapsule

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/knowler-wp-capsule/health.svg)

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

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[cybercog/laravel-ban

Laravel Ban simplify blocking and banning Eloquent models.

1.1k651.8k11](/packages/cybercog-laravel-ban)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[pdphilip/elasticsearch

An Elasticsearch implementation of Laravel's Eloquent ORM

145360.2k4](/packages/pdphilip-elasticsearch)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)

PHPackages © 2026

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