Create isolated, modern WordPress plugins using Laravel's power without conflicts. wp-laracode provides a robust framework for developing WordPress plugins that leverage Laravel's elegant syntax and powerful features while maintaining complete isolation between plugins. Each plugin gets its own container, dependencies, and CLI tool - ensuring zero collisions in multi-plugin environments.
- π Complete Dependency Isolation: Each plugin has its own
vendor/directory and autoloader - β‘ Plugin-Specific CLI: Generated plugins include their own Laravel Zero binary
- π₯ Livewire 3 Integration: Build reactive interfaces with WordPress-native REST endpoints
- ποΈ Eloquent ORM: Use Laravel's database layer with WordPress's
$wpdbconnection - π¨ Blade Templating: Full Blade support with plugin-specific view compilation
- π§ Modern PHP: Requires PHP 8.1+ with type safety and modern practices
- π WordPress-First: Integrates naturally with WordPress hooks, filters, and standards
composer global require andexer/wp-laracode# Navigate to your WordPress plugins directory
cd /path/to/wordpress/wp-content/plugins
# Create a new plugin
wp-laracode new my-awesome-plugin# Enter your plugin directory
cd my-awesome-plugin
# Use the plugin's own CLI
./my-awesome-plugin make:livewire ContactForm
./my-awesome-plugin make:model Product
./my-awesome-plugin migrate
# See all available commands
./my-awesome-plugin list- The plugin will appear in WordPress Admin β Plugins
- Click "Activate"
- Start building!
wp-laracode creates self-contained WordPress plugins with this structure:
my-awesome-plugin/
βββ my-awesome-plugin.php # WordPress entry point
βββ my-awesome-plugin # Plugin-specific CLI binary
βββ app/ # [USER LOGIC] Your application code
β βββ Http/ # Controllers, Livewire Components
β βββ Models/ # Eloquent models
β βββ Providers/ # AppServiceProvider (User config)
βββ bootstrap/ # [FRAMEWORK KERNEL]
β βββ app.php # Application Bootstrapper
β βββ Kernel/ # Core Framework Logic (Console, Services, Hooks)
βββ config/ # Isolated configuration
βββ vendor/ # Plugin's own dependencies (Scoped)
βββ composer.json # Namespaced autoloading
Developing WordPress plugins with modern PHP practices can be challenging due to dependency conflicts and WordPress's procedural nature. wp-laracode solves this by providing:
- Zero Collisions: Multiple plugins can use different Laravel versions
- Modern Workflow: Use Laravel's artisan-like commands
- Maintainable Code: Object-oriented, testable architecture
- Fast Development: Generate components with CLI commands
# Create a new plugin with custom namespace
wp-laracode new booking-system --namespace="BookingSystem"
# Create with specific options
wp-laracode new ecommerce \
--description="WooCommerce enhancements" \
--author="Your Name" \
--license="GPL-2.0-or-later"
# Overwrite existing directory
wp-laracode new my-plugin --forceOnce inside your plugin directory:
# Make new components
./my-plugin make:livewire Dashboard
./my-plugin make:model Order --migration
./my-plugin make:controller ApiController
# Localization
./my-plugin lang:add es fr
./my-plugin lang:update
# Database operations
./my-plugin migrate
./my-plugin make:migration create_products_table
./my-plugin db:seed
# Development helpers
./my-plugin route:list
./my-plugin storage:link
./my-plugin config:cachewp-laracode automatically sets up Livewire with WordPress:
// In your Livewire component
namespace App\Http\Livewire;
use Livewire\Component;
class ContactForm extends Component
{
public $name;
public $email;
public function submit()
{
// Validation and WordPress integration
$this->validate([
'name' => 'required',
'email' => 'required|email',
]);
// Use WordPress functions
wp_insert_post([
'post_title' => $this->name,
'post_content' => $this->email,
'post_type' => 'contact_submission',
]);
session()->flash('message', 'Form submitted successfully!');
}
public function render()
{
return view('livewire.contact-form');
}
}- PHP 8.1 or higher
- Composer 2.0 or higher
- WordPress 5.9 or higher
- MySQL 5.7+ or MariaDB 10.3+
Run multiple wp-laracode plugins simultaneously without conflicts:
# Plugin A (uses Laravel 10)
wp-content/plugins/plugin-a/
βββ plugin-a
βββ vendor/ (Laravel 10)
# Plugin B (uses Laravel 11)
wp-content/plugins/plugin-b/
βββ plugin-b
βββ vendor/ (Laravel 11)Extend your plugin with custom service providers:
./my-plugin make:provider PaymentServiceProviderUse Eloquent with WordPress tables:
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
protected $table = 'posts';
protected $primaryKey = 'ID';
public function meta()
{
return $this->hasMany(PostMeta::class, 'post_id', 'ID');
}
}We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
wp-laracode is open-source software licensed under the MIT license.
If your company:
- Has more than 10 employees
- Generates revenue using this software
- Offers commercial products/services based on this code
Please consider:
This is not a legal requirement, but an ethical request to support ongoing open-source development.
- π Documentation
- π Issue Tracker
- π¬ Discussions
- π Changelog
We welcome contributors! If you would like to improve wp-laracode, please read our Contribution Guide.
This project is maintained by Andexer Arvelo.
If you find this project useful, please consider making a donation to support its active development (completely optional).
I am open to collaborations and support to keep improving wp-laracode! You can contribute in several ways:
- Code Contributions: Pull requests are always welcome. If you have a fix or a new feature, feel free to submit it!
- Direct Collaborators: If you want to be more involved in the project as a direct collaborator, please get in touch.
- Financial Support: If this tool saves you time or helps your business, consider making a donation. Every bit helps to maintain and improve the framework.
You can support the project financially via PayPal:
π Donate via PayPal
Ready to transform your WordPress development? Install wp-laracode today and start building better plugins with Laravel's power and WordPress's flexibility!
composer global require andexer/wp-laracode
wp-laracode new your-plugin-nameHappy coding! π
wp-laracode is not affiliated with or endorsed by the WordPress Foundation or Laravel.