Laravel Illuminate Capsule configured for WordPress.
knowler/wp-capsule is a Laravel package for laravel illuminate capsule configured for wordpress..
It currently has 2 GitHub stars and 315 downloads on Packagist (latest version 0.2.0).
Install it with composer require knowler/wp-capsule.
Discover more Laravel packages by knowler
or browse all Laravel packages to compare alternatives.
Last updated
Illuminate's Capsule 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 under the hood. It works well if you are using Bedrock.
composer require knowler/wp-capsule
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');
});
Feel free to make a pull request or report issues. I threw this together pretty quickly.