Configuration
The CLI tool uses minimal configuration, auto-detecting plugin settings from composer.json.
Namespace Detection
The tool reads your PSR-4 autoload configuration:
{
"autoload": {
"psr-4": {
"MyPlugin\\": "app/"
}
}
}
Generated files will use the detected namespace.
Output Directories
Default output directories (relative to your plugin root):
| Command | Default Path |
|---|---|
make:controller | app/Http/Controllers/ |
make:request | app/Http/Requests/ |
make:migration | database/migrations/ |
Stub Customization
To customize generated code, you can override the default stubs.
Creating Custom Stubs
- Create a
stubs/directory in your plugin root:
my-plugin/
+-- stubs/
— +-- controller.stub
— +-- request.stub
— +-- migration.stub
- Copy the default stubs and modify as needed.
Stub Tokens
Available tokens for replacement:
| Token | Description |
|---|---|
{{namespace}} | PHP namespace |
{{class}} | Class name |
{{slug}} | Plugin slug |
{{prefix}} | Database prefix |
{{textDomain}} | Text domain |
{{table}} | Table name (migrations) |
Environment Variables
No environment variables are required. The tool works out of the box.
Related
- Usage Guide — Command usage
- Examples — Real-world examples