Problem
Laravel Boost currently only scans the app/ directory when discovering Eloquent models. This means projects using Domain-Driven Design (DDD) or other non-standard architectures don't get their models detected.
In src/Install/GuidelineAssist.php, the discover() method is hardcoded to use app_path():
protected function discover(callable $cb): array
{
$classes = [];
$appPath = app_path(); // Only scans app/ directory
// ...
$finder = Finder::create()
->in($appPath) // Hardcoded
->files()
->name('/[A-Z].*\.php$/');
Use Case
Many Laravel projects organize code using DDD patterns with models in directories like:
src/
├── Domain/
│ ├── Identity/
│ │ └── Models/
│ │ └── User.php
│ └── Authorization/
│ └── Models/
│ ├── Role.php
│ └── Permission.php
These projects have proper PSR-4 autoloading configured in composer.json:
{
"autoload": {
"psr-4": {
"App\\": "src/App/",
"Domain\\": "src/Domain/"
}
}
}
Suggested Solution
Add a configuration option in boost.json or config/boost.php to specify additional model paths:
{
"model_paths": [
"src/Domain"
]
}
Or alternatively, automatically discover models based on the PSR-4 autoload configuration in composer.json.
Current Workaround
The DatabaseSchema tool works fine since it reads directly from the database, but the ApplicationInfo resource returns an empty models array, which limits AI agents' understanding of the codebase structure.
Environment
- Laravel Boost version: latest
- Laravel version: 12.x
- PHP version: 8.3
Problem
Laravel Boost currently only scans the
app/directory when discovering Eloquent models. This means projects using Domain-Driven Design (DDD) or other non-standard architectures don't get their models detected.In
src/Install/GuidelineAssist.php, thediscover()method is hardcoded to useapp_path():Use Case
Many Laravel projects organize code using DDD patterns with models in directories like:
These projects have proper PSR-4 autoloading configured in
composer.json:{ "autoload": { "psr-4": { "App\\": "src/App/", "Domain\\": "src/Domain/" } } }Suggested Solution
Add a configuration option in
boost.jsonorconfig/boost.phpto specify additional model paths:{ "model_paths": [ "src/Domain" ] }Or alternatively, automatically discover models based on the PSR-4 autoload configuration in
composer.json.Current Workaround
The
DatabaseSchematool works fine since it reads directly from the database, but theApplicationInforesource returns an empty models array, which limits AI agents' understanding of the codebase structure.Environment