Private Folders
Private folders can be created by prefixing a folder with an underscore: _folderName
This indicates the folder is a private implementation detail and should not be considered by the routing system, thereby opting the folder and all its subfolders out of routing.
Since files in the app
directory can be safely colocated by default, private folders are not required for colocation. However, they can be useful for:
- Separating UI logic from routing logic.
- Consistently organizing internal files across a project and the Prisma PHP ecosystem.
- Sorting and grouping files in code editors.
- Avoiding potential naming conflicts with future Prisma PHP file conventions.
Good to know:
- While not a framework convention, you might also consider marking files outside private folders as "private" using the same underscore pattern.
- You can create URL segments that start with an underscore by prefixing the folder name with
%5F
(the URL-encoded form of an underscore):%5FfolderName
. - If you don't use private folders, it would be helpful to know Prisma PHP special file conventions to prevent unexpected naming conflicts.