Download the PHP package travelopia/wordpress-blade without Composer
On this page you can find all versions of the php package travelopia/wordpress-blade. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download travelopia/wordpress-blade
More information about travelopia/wordpress-blade
Files in travelopia/wordpress-blade
Package wordpress-blade
Short Description Use Laravel Blade components in WordPress.
License MIT
Informations about the package wordpress-blade
WordPress Blade Plugin
Use Laravel Blade components in WordPress.
🚨 Note: Only Anonymous Components are currently supported: https://laravel.com/docs/10.x/blade#anonymous-components
Built by the super talented team at Travelopia. |
Video Tutorial
▶ ️tutorial
Installation
Install via Composer (recommended):
-
Your composer file should include this
- This installs it as an MU Plugin.
-
Then load this plugin in your mu plugins loader file e.g. mu-plugins/loader.php
- Then require the autoload file from vendor directory by adding the following code in your wp-config.php file.
Manual Installation (if you know what you are doing):
- Download this repository as a ZIP file.
- Run
composer install --no-dev --optimize-autoloader
- Use it either as an MU plugin or a normal plugin!
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
First, create a blade.config.php
file at the root of your project, and add the following code in there:
Bootstrap a layout.
As a best practice, and if applicable, bootstrap an entire layout like so:
And then load the view in your template:
You can also load an individual component like so:
This is especially useful when you want to load components from Blocks and Full Site Editing.