PHPackages                             andexer/wp-laracode - 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. andexer/wp-laracode

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

andexer/wp-laracode
===================

Create isolated, modern WordPress plugins using Laravel's power without conflicts.

2.0.14(3mo ago)130MITPHPPHP ^8.2

Since Jan 25Pushed 3mo agoCompare

[ Source](https://github.com/andexer/wp-laracode)[ Packagist](https://packagist.org/packages/andexer/wp-laracode)[ Docs](https://github.com/andexer/wp-laracode)[ RSS](/packages/andexer-wp-laracode/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (66)Used By (0)

wp-laracode - WordPress Plugin Generator with Laravel Components
================================================================

[](#wp-laracode---wordpress-plugin-generator-with-laravel-components)

**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.

✨ Features
----------

[](#-features)

- **🚀 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 `$wpdb` connection
- **🎨 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

📦 Quick Start
-------------

[](#-quick-start)

### 1. Install the CLI Tool

[](#1-install-the-cli-tool)

```
composer global require andexer/wp-laracode
```

### 2. Create a New Plugin

[](#2-create-a-new-plugin)

```
# Navigate to your WordPress plugins directory
cd /path/to/wordpress/wp-content/plugins

# Create a new plugin
wp-laracode new my-awesome-plugin
```

### 3. Start Developing

[](#3-start-developing)

```
# 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
```

### 4. Activate in WordPress

[](#4-activate-in-wordpress)

1. The plugin will appear in WordPress Admin → Plugins
2. Click "Activate"
3. Start building!

🏗️ Architecture
---------------

[](#️-architecture)

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

```

🎯 Why wp-laracode?
------------------

[](#-why-wp-laracode)

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

📖 Documentation
---------------

[](#-documentation)

### Basic Usage

[](#basic-usage)

```
# 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 --force
```

### Plugin CLI Commands

[](#plugin-cli-commands)

Once 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:cache
```

### Livewire in WordPress

[](#livewire-in-wordpress)

wp-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');
    }
}
```

🔧 Requirements
--------------

[](#-requirements)

- PHP 8.1 or higher
- Composer 2.0 or higher
- WordPress 5.9 or higher
- MySQL 5.7+ or MariaDB 10.3+

🚀 Advanced Features
-------------------

[](#-advanced-features)

### Multiple Plugin Support

[](#multiple-plugin-support)

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)
```

### Custom Service Providers

[](#custom-service-providers)

Extend your plugin with custom service providers:

```
./my-plugin make:provider PaymentServiceProvider
```

### Database Integration

[](#database-integration)

Use 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');
    }
}
```

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Submit a pull request

📄 License
---------

[](#-license)

wp-laracode is open-source software licensed under the [MIT license](LICENSE).

### For Companies

[](#for-companies)

If your company:

- Has more than 10 employees
- Generates revenue using this software
- Offers commercial products/services based on this code

Please consider:

1. [Obtaining a commercial license](https://example.com/license)
2. [Becoming a sponsor](https://github.com/sponsors/andexer)
3. [Contributing improvements](CONTRIBUTING.md)

This is not a legal requirement, but an ethical request to support ongoing open-source development.

🛠️ Support
----------

[](#️-support)

- 📚 [Documentation](https://github.com/andexer/wp-laracode/wiki)
- 🐛 [Issue Tracker](https://github.com/andexer/wp-laracode/issues)
- 💬 [Discussions](https://github.com/andexer/wp-laracode/discussions)
- 🚀 [Changelog](CHANGELOG.md)

🤝 Contributors
--------------

[](#-contributors)

We welcome contributors! If you would like to improve `wp-laracode`, please read our [Contribution Guide](CONTRIBUTING.md).

This project is maintained by [Andexer Arvelo](https://github.com/andexer).

☕ Donations
-----------

[](#-donations)

If you find this project useful, please consider making a donation to support its active development (completely optional).

- [PayPal](https://paypal.me/arvelofalcon)

---

🤝 Support &amp; Contributions
-----------------------------

[](#-support--contributions)

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.

### 💸 Donations

[](#-donations-1)

You can support the project financially via PayPal:

👉 **[Donate via PayPal](https://paypal.me/arvelofalcon)**

---

**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-name
```

Happy coding! 🎉

---

*wp-laracode is not affiliated with or endorsed by the WordPress Foundation or Laravel.*

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance79

Regular maintenance activity

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

65

Last Release

111d ago

Major Versions

v1.0.50 → v2.0.02026-01-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/f99bfa5ffa3b2c1e0f22b8b251a60239225f6b40b51bd9eb06e8c95e19aaaec8?d=identicon)[andexer](/maintainers/andexer)

---

Top Contributors

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

---

Tags

clilaravelwordpresseloquentbladelivewireplugin-framework

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/andexer-wp-laracode/health.svg)

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

###  Alternatives

[flynsarmy/db-blade-compiler

Render Blade templates from Eloquent Model Fields

170866.2k2](/packages/flynsarmy-db-blade-compiler)[henzeb/enumhancer

Your framework-agnostic Swiss Army knife for PHP 8.1+ native enums

69287.4k2](/packages/henzeb-enumhancer)[rtconner/laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

394388.0k5](/packages/rtconner-laravel-likeable)[drewjbartlett/wordpress-eloquent

A Laravel wrapper for wordpress which turns all Wordpress models into Laravel Eloquent Models.

1521.5k](/packages/drewjbartlett-wordpress-eloquent)[boaideas/laravel-cli-create-user

An artisan command to create, list and remove users in a laravel application from the cli

1610.7k](/packages/boaideas-laravel-cli-create-user)

PHPackages © 2026

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