Skip to content

Conversation

@antojdprop
Copy link

Fix casing in directory path for Inertia components

Fix casing in directory path for Inertia components
## Inertia Core

- Inertia.js components should be placed in the `resources/js/Pages` directory unless specified differently in the JS bundler (vite.config.js).
- Inertia.js components should be placed in the `resources/js/pages` directory unless specified differently in the JS bundler (vite.config.js).
Copy link
Member

@pushpak1300 pushpak1300 Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antojdprop thanks for the PR.

I thought about this a bit more. Hardcoding the path will break for Laravel 11 starter kits (Jetstream, Breeze, etc). Instead of doing that, can we detect the path dynamically at runtime?

For example, we could use something like:

preg_match('/[pP]ages/', $appContents, $matches);

If we detect it in any of the expected files (in priority order), we use that. If we cannot detect it, we fall back to generic wording:

"Inertia pages are stored in resources/js/ unless specified differently in the JS bundler (vite.config.js)."

That way it works across versions without assuming folder structure.

@pushpak1300 pushpak1300 requested review from pushpak1300 and removed request for taylorotwell October 31, 2025 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants