PHPackages                             travelopia/wordpress-blade - 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. travelopia/wordpress-blade

ActiveWordpress-muplugin[Utility &amp; Helpers](/categories/utility)

travelopia/wordpress-blade
==========================

Use Laravel Blade components in WordPress.

1.1.1(4mo ago)77.4k↓37.5%1MITPHPCI passing

Since Aug 21Pushed 4mo ago9 watchersCompare

[ Source](https://github.com/Travelopia/wordpress-blade)[ Packagist](https://packagist.org/packages/travelopia/wordpress-blade)[ RSS](/packages/travelopia-wordpress-blade/feed)WikiDiscussions main Synced 1mo ago

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

WordPress Blade Plugin
======================

[](#wordpress-blade-plugin)

[![maintenance-status](https://camo.githubusercontent.com/cfed6dc6fddd5928206fc6563093b42c7fe0743e15681325f9f06dad017ed885/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d61696e74656e616e63652d6163746976656c792d2d646576656c6f7065642d627269676874677265656e2e737667)](https://camo.githubusercontent.com/cfed6dc6fddd5928206fc6563093b42c7fe0743e15681325f9f06dad017ed885/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d61696e74656e616e63652d6163746976656c792d2d646576656c6f7065642d627269676874677265656e2e737667)

Use Laravel Blade components in WordPress.

🚨 Note: Only Anonymous Components are currently supported:

  Built by the super talented team at **[Travelopia](https://www.travelopia.com/work-with-us/)**.

   [![](https://camo.githubusercontent.com/b6d2c5265f0a72e4cab9dc3a452c4c479ac298969d9aa08afca93ceb681c39a3/68747470733a2f2f7777772e74726176656c6f7069612e636f6d2f77702d636f6e74656e742f7468656d65732f74726176656c6f7069612f7372632f6173736574732f7376672f6c6f676f2d74726176656c6f7069612d636972636c652e737667)](https://camo.githubusercontent.com/b6d2c5265f0a72e4cab9dc3a452c4c479ac298969d9aa08afca93ceb681c39a3/68747470733a2f2f7777772e74726176656c6f7069612e636f6d2f77702d636f6e74656e742f7468656d65732f74726176656c6f7069612f7372632f6173736574732f7376672f6c6f676f2d74726176656c6f7069612d636972636c652e737667)  Video Tutorial
--------------

[](#video-tutorial)

▶ ️[tutorial](https://www.youtube.com/watch?v=M7aCzMkL7Lo)

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

[](#installation)

### Install via Composer (recommended):

[](#install-via-composer-recommended)

```
$ composer require travelopia/wordpress-blade

```

- Your composer file should include this

```
{
	"name": "your/packagename",
	"description": "Description",
	"extra": {
		"installer-paths": {
			"wp-content/mu-plugins/{$name}/": ["type:wordpress-muplugin"]
		}
	},
	"require": {
		"travelopia/wordpress-blade": "^1.0.0",
		"composer/installers": "^2.3"
	},
	"config": {
		"allow-plugins": {
			"composer/installers": true
		}
	},
	"scripts": {
		"wordpress-blade": "wordpress-blade"
	}
}
```

- This installs it as an MU Plugin.
- Then load this plugin in your mu plugins loader file e.g. mu-plugins/loader.php

```
require_once WPMU_PLUGIN_DIR . '/wordpress-blade/plugin.php';
```

- Then require the autoload file from vendor directory by adding the following code in your wp-config.php file.

```
require_once 'vendor/autoload.php';
```

### Manual Installation (if you know what you are doing):

[](#manual-installation-if-you-know-what-you-are-doing)

1. Download this repository as a ZIP file.
2. Run `composer install --no-dev --optimize-autoloader`
3. Use it either as an MU plugin or a normal plugin!

Building for Production
-----------------------

[](#building-for-production)

Compile your Blade components for production as a best practice. Some production environments are read-only, in which case this step is necessary.

Run the following command:

`composer exec wordpress-blade -- --config-file=blade.config.php` - Ensure the path to the Blade config is correct.

Usage
-----

[](#usage)

First, create a `blade.config.php` file at the root of your project, and add the following code in there:

```
