Support the ongoing development of →
Blade Views Security
Last updated 2 years ago.

It is discouraged to do in a view so there is no blade tag for it. If you do want to do this in your blade view, you can either just open a php tag as you wrote it or register a new blade tag. Just an example:

<?php /** * <code> * {? $old_section = "whatever" ?} * </code> */ Blade::extend(function($value) { return preg_replace('/\{\?(.+)\?\}/', '<?php ${1} ?>', $value);


By:Xtreem Solution

Highly Skilled Laravel Developer

Dedicated PHP Developer


I want block blade for security reasons, because I have a pages manager and some users can change the blade, but when you write @env("DB_PASSWORD") to blade, everyone get DB password.


Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.