I can imagine the following:
- add a new folder study with it's own
index.php
copied from the directory above and with changed paths so that it also loads flarum
- create a new custom middleware that checks for the path segment
study
and based on that set a global value somewhere (bound into ioc or as a singleton value)
- register a Global Scope to models that would need to distinguish between being in study or not. The scope reads the global value and modifies all queries to those models from that moment on. You could probably assign it to Discussion for instance.
This strategy might have some downsides. Eg if you apply a global scope to tags how do you manage them in your admin area? I guess the global variable needs to understand if you're in the admin area too and not enable the scope in that situation.
Very technical, not sure this helps 😛