Radius Booking Plugin — WP‐CLI Artisan Command Documentation - mdhrshahin20/documentation GitHub Wiki

This document provides clear instructions for developers using the Artisan-style WP-CLI commands in the Radius Booking plugin to quickly scaffold and manage your plugin's modules, database, and API architecture.


📦 Artisan Command Namespace

All commands are registered under:

wp radius artisan

⚙️ Module Development Structure

Each module follows a standard Laravel-style architecture:

Model → Repository → Resource → Service → Controller

You can generate each component manually or in one go using the make:module command.


💪 Available Commands

🔧 Table Commands

Command Description
wp radius artisan make:table TableName Generate a migration table class (e.g. CategoriesTable).
wp radius artisan delete:table TableName Delete the migration table class (e.g. CategoriesTable).

🔀 Lifecycle Example

Let's say you want to create a Location module with migration:

wp radius artisan make:table LocationsTable
wp radius artisan make:module Location
wp radius artisan migrate

Done! Now you have a fully functional module with:

  • A Location model

  • API-ready controller

  • Business logic layer

  • REST transformation logic

  • Registered route via your plugin router


🥪 Tips for Developers

  • Follow naming conventions (e.g. CategoriesTable, UserProfileRepository).

  • Use make:module when starting fresh to speed up development.

  • Use migrate --refresh frequently during dev to reset schema quickly.

  • Use controller, service, and repository layers to separate responsibilities cleanly.

  • Every generated controller supports RESTful structure and is registered in the plugin API.


📚 Summary Cheat Sheet

# Table
wp radius artisan make:table CategoriesTable
wp radius artisan delete:table CategoriesTable

Migration

wp radius artisan migrate wp radius artisan migrate --refresh wp radius artisan migrate --status wp radius artisan migrate --rollback --steps=1

Module Parts

wp radius artisan make:model User wp radius artisan make:repository UserRepository wp radius artisan make:resource UserResource wp radius artisan make:service UserService wp radius artisan make:controller UserController

All-in-One

wp radius artisan make:module User

⚠️ **GitHub.com Fallback** ⚠️