andexer / wp-laracode
Create isolated, modern WordPress plugins using Laravel's power without conflicts.
Requires
- php: ^8.2
- laravel-zero/framework: ^12.0.2
Requires (Dev)
- laravel/pint: ^1.25.1
- mockery/mockery: ^1.6.12
- pestphp/pest: ^3.8.4|^4.1.2
- dev-main
- 2.0.14
- 2.0.13
- 2.0.12
- 2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.0.50
- v1.0.49
- v1.0.48
- v1.0.47
- v1.0.46
- v1.0.45
- v1.0.44
- v1.0.43
- v1.0.42
- v1.0.41
- v1.0.40
- v1.0.39
- v1.0.38
- v1.0.37
- v1.0.36
- v1.0.35
- v1.0.34
- v1.0.33
- v1.0.32
- v1.0.31
- v1.0.30
- v1.0.29
- v1.0.28
- v1.0.27
- v1.0.26
- v1.0.25
- v1.0.24
- v1.0.23
- v1.0.22
- v1.0.21
- v1.0.20
- v1.0.19
- v1.0.18
- v1.0.17
- v1.0.16
- v1.0.15
- v1.0.14
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
This package is auto-updated.
Last update: 2026-02-28 00:51:09 UTC
README
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
- 🚀 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
📦 Quick Start
1. Install the CLI Tool
composer global require andexer/wp-laracode
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
# 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
- The plugin will appear in WordPress Admin → Plugins
- Click "Activate"
- Start building!
🏗️ 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?
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
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
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
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
- PHP 8.1 or higher
- Composer 2.0 or higher
- WordPress 5.9 or higher
- MySQL 5.7+ or MariaDB 10.3+
🚀 Advanced Features
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
Extend your plugin with custom service providers:
./my-plugin make:provider PaymentServiceProvider
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
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
📄 License
wp-laracode is open-source software licensed under the MIT license.
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:
This is not a legal requirement, but an ethical request to support ongoing open-source development.
🛠️ Support
🤝 Contributors
We welcome contributors! If you would like to improve wp-laracode, please read our Contribution Guide.
This project is maintained by Andexer Arvelo.
☕ Donations
If you find this project useful, please consider making a donation to support its active development (completely optional).
🤝 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
You can support the project financially 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-name
Happy coding! 🎉
wp-laracode is not affiliated with or endorsed by the WordPress Foundation or Laravel.