I'm building a hosted CMS with Laravel, that allows users to create their own themes. I've implemented Mustache templates for the user themes to prevent the use of logic, and namespaced the views for the app itself to stop users from being able to call them form within their views, but if they chose to do so, a user could still put a .blade.php file in their theme directory and would be able to then use logic. User::delete()
for example.
I'm looking for a way to turn of both blade and php views when the hostname is not in an array of whitelist values.
Something like:
if (!in_array(Request::getHost(), $hosts)) {
// Turn off blade and php views
}
Does anyone now how I would do this, and where I should put the code to do it?