Reputation: 16792
I want to let people upload template files but I don't want them to be able to run PHP code (and looking at the blade docs it looks like people can). Any ideas? Or if I should be looking at another solution what would be a good one?
Thanks.
Upvotes: 0
Views: 530
Reputation: 180024
Blade is not a good solution for this - it's basically an alternative syntax for PHP.
Something like Twig is a better option - it doesn't allow raw PHP code, and you can additionally whitelist only specific functions/attributes/etc. in its sandbox mode. Users have access only to the stuff you want them to have.
Upvotes: 2