AI in LacePHP¶
Warning
LacePHP’s AI features are powerful tools to speed up your work, but they should never replace careful architectural design or security reviews.
Please note that an active internet connection is required to use the AI functionality.
LacePHP includes a built-in AI assistant—LaceAI—to help you scaffold code, explain tricky lines, and boost your productivity. Instead of writing boilerplate by hand or struggling to understand legacy code, you can let AI generate controllers, models, routes and more. A peer-coding “buddy” feature even lets you ask natural-language questions about your code.
Why LaceAI Matters¶
Save time by auto-generating repetitive code (CRUD operations, API endpoints, validation).
Learn as you go: inspect AI-generated examples and adapt them to your style.
On-demand help: use the AI buddy to clarify confusing code without leaving your terminal.
Getting a License¶
You must register at LacePHP’s portal and obtain a license key:
Open your browser to https://app.lacephp.com/register
Sign up with your email and follow the verification steps.
Log in and copy your LaceAI license key from the dashboard.
Activating Your License¶
In your project root, run:
php lace ai:activate
You will be prompted to paste your license key. After validation you’ll see:
AI license activated! Enjoy LaceAI features.
Checking License Status¶
php lace ai:status
Shows your current subscription tier and expiry date.
Scaffolding Code¶
Generate new code from a simple prompt. For example, to create a complete post/comment API:
php lace ai:scaffold "Full implementation of post and comment API for blog"
LaceAI will:
Create migrations, models, controllers and routes under weave/
Populate methods with example logic (validation, CRUD, JSON responses)
Print each file written so you can review or customise.
Rolling Back Generated Code¶
If the scaffold doesn’t meet your needs:
php lace ai:rollback
This undoes the last scaffold operation by deleting or reverting the files LaceAI created.
Peer-Coding Buddy¶
Ask LaceAI questions about specific lines in your codebase:
php lace ai:buddy "Why is this query failing?"
LaceAI will display a natural-language explanation and, when possible, suggest fixes.
Best Practices¶
Review every scaffold before committing—AI is a helper, not a replacement for design.
Use rollback frequently when experimenting with prompts.
Combine AI with your own knowledge: AI can suggest patterns, but always adapt to your project’s conventions.
Secure your license key—do not commit it to source control.
Warning
Never use this plugin in production. Remove the plugin when on production server
AI-generated code may contain errors or insecure patterns—always run tests and security scans.
LaceAI usage may be rate-limited or billable—monitor your usage in the LacePHP dashboard.
Do not expose sensitive data in your prompts (API keys, passwords, personal information).
With LaceAI, you gain an on-demand coding assistant right in your terminal that helps you to learn, build and iterate faster than ever.