Migrating Laravel applications to ZinTrust
@zintrust/laravel-to-zintrust is a local MCP server that analyzes a Laravel codebase and helps you move it to ZinTrust. It is deliberately two-phase: analysis never changes the Laravel repository, and generation writes only into an existing ZinTrust app you already created with zin new.
What it inventories
- Eloquent models, relationships, casts, hidden/fillable fields and soft deletes
- Migrations, including anonymous migrations from Laravel 11+
- Routes, middleware, controllers and FormRequests
- Queued jobs, schedules, events, policies, notifications, mail and broadcasts
- Auth packages and framework features that need a human decision
Every artifact carries a confidence level, a source snippet, a target path, a plain-language Laravel → ZinTrust mapping, doc links and warnings. Unsupported constructs are reported instead of guessed.
How it works
- Analyze. Point the tool at a Laravel repository. Version detection uses
composer.lock,composer.jsonand directory layout, so Laravel 6 through 13 are handled with the same output shape. - Review mappings. Inspect each artifact and record decisions for anything the tool flagged. Manifests can be checkpointed outside the source repo and resumed later.
- Generate. Generate models, migrations, controllers, routes, jobs, workers, schedules, auth setup, policies and integration stubs into the target ZinTrust app. Generated files contain a
NEEDS REVIEWheader showing the source file, target file and mapping beside the code. Passport, Sanctum, Fortify and 2FA setups stay as recorded manual decisions. - Verify. Compare expected routes and schedules against
zin routes --jsonandzin schedule:list --json. Optional runtime/QA checks invokezin s,zin s --wg, andzin qa; timeouts fail rather than proving readiness. Check both runtimes independently with HTTP health checks and application tests.mapping_coveragemeasures mapping metadata, not translated business logic;coverage_by_profilemeasures file-generation progress, not correctness. Neither 80% indicator proves migration completeness.
Safety rules
- Static analysis does not execute PHP or write source files. Scanning filters paths and skips symlinks and vendor directories; this is not an OS sandbox, and PHP source can contain secrets.
- A target must be an existing ZinTrust app; nothing is scaffolded automatically.
- The target and source roots must not overlap. Existing generated destinations are skipped unless
overwriteis set; route generation can still patchroutes/api.tsto register the generated routes. - Generated code follows the ZinTrust conventions: plain TypeScript,
@zintrust/coreimports, factory functions instead of classes, and no runtime-specific branches. - Optional Artisan inspection and verification execute trusted application code, which can have boot-time side effects. Review tool access and your MCP client's handling of source snippets.
Running it
Use Node.js 22.12 or newer. No source checkout or global installation is required:
claude mcp add laravel-to-zintrust -- npx -y @zintrust/laravel-to-zintrustFor Claude Desktop or Cursor (.cursor/mcp.json), use:
{
"mcpServers": {
"laravel-to-zintrust": {
"command": "npx",
"args": ["-y", "@zintrust/laravel-to-zintrust"]
}
}
}VS Code uses .vscode/mcp.json with a different shape:
{
"servers": {
"laravel-to-zintrust": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@zintrust/laravel-to-zintrust"]
}
}
}The command waits for MCP messages over stdio. Provide the absolute Laravel repository path as repoPath to analyze_laravel_project, not as a command-line argument. Use stateDir outside the source repository to checkpoint progress; after a server restart, call load_manifest before using its ID again. Pin a reviewed published package version in client configurations when reproducibility matters.
Migration boundaries
Controllers, job processors, policies, configuration, and integrations include scaffolds or review stubs, not translated business logic. Review resource/group routes, middleware semantics, model casts/relationships, schema-alter operations, foreign keys, column modifiers, schedules/timezones, and adapter registration manually. Passport, Sanctum, Fortify, MFA, AI/vector features, providers, and third-party integrations are not comprehensively converted.
Never deploy generated code or run generated database migrations without reviewing the diff, testing the target schema, and verifying behavior with representative application tests. The package README contains setup, tool arguments, a step-by-step workflow, JavaScript API usage, and troubleshooting.