MWZ

MINDWAREZONE

beginnerLaravel

What are Blade layouts and sections?

Answer

Clear, interview-ready explanation

Blade layouts provide a reusable page shell, such as common HTML, navigation, and footer markup. A layout uses @yield to declare named regions where child views may provide content.

A child view uses @extends to select a layout and @section with @endsection to fill a region. This avoids duplicating shared markup across pages and keeps individual views focused on their own content. Components are often a stronger choice for reusable UI pieces with attributes and slots, while template inheritance remains useful for page-level structure.