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

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

0

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.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.