DiscoverNo CompromisesUnderstanding how Stringable works inside Blade views
Understanding how Stringable works inside Blade views

Understanding how Stringable works inside Blade views

Update: 2025-05-24
Share

Description

Joel and Aaron dig into Laravel’s `Stringable` class and uncover how it can silently skip Blade’s automatic HTML escaping. They explain why that’s both a convenient feature and a potential security pitfall if user input isn’t properly sanitized. You’ll hear practical ways to keep your views safe without losing the API’s fluency.

  • (00:00 ) - Stringable can sidestep Blade escaping

  • (03:45 ) - Dangers of outputting unsanitized HTML

  • (05:45 ) - Defensive strategies for safe rendering

  • (08:45 ) - Silly bit


Sign up for a short, but useful, Laravel tip each day in our newsletter
Comments 
00:00
00:00
x

0.5x

0.8x

1.0x

1.25x

1.5x

2.0x

3.0x

Sleep Timer

Off

End of Episode

5 Minutes

10 Minutes

15 Minutes

30 Minutes

45 Minutes

60 Minutes

120 Minutes

Understanding how Stringable works inside Blade views

Understanding how Stringable works inside Blade views

Joel Clermont and Aaron Saray