Blade gives you two big levers for keeping views maintainable: the @include
directive and Blade components.
When should you use one versus the other?
Does it matter?
In the latest episode of the No Compromises podcast, we lay out a clear heuristic for when to extract markup for organization (includes) versus when to encapsulate and reuse with controlled scope (components).
We also touch on scope pitfalls, “passing for documentation,” and why performance worries usually lie elsewhere.
- 00:00 Why we lean on Blade for most projects
- 04:00 Using @include to keep massive templates readable
- 06:45 Include scope: pros, cons, and when it confuses
- 08:45 Don’t “pass for documentation” — scope vs clarity
- 09:45 Blade components for reusable, scoped UI with normalized props
- 12:00 Performance considerations (and overusing nested components)
- 13:45 Silly bit
And after listening, don't forget to subscribe to the podcast, so you don't miss future episodes.
Here to help,
Joel
P.S. Would you like some expert help on your Laravel project?