Describe the bug
leaf serve in an MVC project is completely non-functional due to a broken
delegation chain:
- Global
leaf CLI detects MVC app via isMVCApp()
- Delegates to
php leaf serve locally
- Local
vendor/bin/leaf proxies to leafs/schema bin (a database migration tool)
leafs/schema has no serve command — fails silently, all requests return 404
To Reproduce
- Scaffold a fresh Leaf MVC project
- Run
leaf serve from the project root
- Visit
http://localhost:5500/
Expected behavior
App is served correctly, routes respond as defined.
Actual behavior
All requests return 404, including /. The server starts but nothing works.
Root cause
In ServeCommand.php:
if ($this->isMVCApp()) {
return (int) sprout()->run("php leaf serve --port={$this->option('port')} --ansi", null);
}
vendor/bin/leaf resolves to leafs/schema/bin/leaf, not a serve handler.
Workaround
Add to composer.json:
"scripts": {
"serve": "php -S localhost:5500 -t public public/index.php"
}
Then run composer run serve.
Environment
- leafs/cli version: v4.6.0
- leafs/sprout version: 0.9.2
- leafs/schema version: 0.1.1
- OS: Linux
Describe the bug
leaf servein an MVC project is completely non-functional due to a brokendelegation chain:
leafCLI detects MVC app viaisMVCApp()php leaf servelocallyvendor/bin/leafproxies toleafs/schemabin (a database migration tool)leafs/schemahas noservecommand — fails silently, all requests return 404To Reproduce
leaf servefrom the project roothttp://localhost:5500/Expected behavior
App is served correctly, routes respond as defined.
Actual behavior
All requests return 404, including
/. The server starts but nothing works.Root cause
In
ServeCommand.php:vendor/bin/leafresolves toleafs/schema/bin/leaf, not a serve handler.Workaround
Add to
composer.json:Then run
composer run serve.Environment