A modern, Laravel-inspired framework to build modular and maintainable WordPress plugins. Designed for developers who want structure, separation of concerns, and a full-featured developer experience.
- MVC architecture
- Laravel-style routing and validation
- Database migrations and seeders
- Custom post types with models/resources
- Clean admin menu handler
- REST API support out of the box
- Vue 3 + SCSS based frontend architecture
ehx-directorist/
├── app/
│ ├── Core/
│ ├── Database/
│ │ ├── Migrations/ # Migration classes
│ │ ├── Seeders/ # Seeder classes
│ │ └── Migrator.php # Migration runner
│ ├── Hooks/
│ │ ├── CLI/
│ │ └── Handler/AdminMenuHandler.php
│ ├── Http/
│ │ ├── Controllers/ # API controllers
│ │ ├── Requests/ # Form requests (validation)
│ │ └── Router/ # Laravel-style route handling
│ ├── Models/ # Custom models (e.g., Category, Courier)
│ └── Resources/ # Data transformers for responses
│
├── assets/ # Compiled assets (dist)
├── node_modules/ # Node dependencies
├── resources/
│ ├── js/
│ │ ├── admin/ # Admin panel-specific code
│ │ ├── components/ # Vue components
│ │ ├── modules/ # Feature modules
│ │ ├── app.js # Entry point
│ │ └── App.vue # Root Vue component
│ └── scss/ # SCSS styles
├── routes/ # Route files (e.g., api.php)
├── vendor/ # Composer dependencies
├── composer.json
└── ehx-directorist.php # Plugin bootstrap
git clone https://github.com/yourusername/ehx-directorist.git wp-content/plugins/ehx-directorist
cd wp-content/plugins/ehx-directorist
composer install
npm installnpm run dev # For development
npm run build # For productionActivate Ehx Directorist from your WordPress admin dashboard.
In routes/api.php:
API_Router::get('/categories', [CategoryController::class, 'index']);
API_Router::post('/categories', [CategoryController::class, 'store']);class StoreCategoryRequest extends BaseRequest {
public function rules(): array {
return [
'name' => 'required|string|max:255',
];
}
}In controller:
public static function store(StoreCategoryRequest $request) {
$validated = $request->validated();
// process data
}Migration: app/Database/Migrations/CreateMenuCategoriesTable.php
Seeder: app/Database/Seeders/YourSeeder.php
Run migrations:
(new \WooCommerceSmartCoupons\Database\Migrator())->run();Add admin menu via:
new AdminMenuHandler();- Vue 3 single-file components
- SCSS for styling
- Laravel Mix/Vite supported build process
PRs are welcome! Please open an issue first to discuss significant changes or ideas.