Views contain the HTML served by the frontend of your application. You can find and define views in the resources/views directory. A simple view might look something like this:

// resources/views/welcome.blade.php
        <h1>@verbatim{{ config('') }}@endverbatim</h1>

Each file inside your resources/views directory is a view and is available for use however you like.


Layouts are the outer structural foundation of your application's HTML. It is considered best practice to leverage layouts via view inheritance to abstract your view presentation.

// resources/views/layouts/default.blade.php
        <title>App Name - @yield('title')</title>
            This is the default sidebar.

        <div class="container">

Extending Layouts

When defining a child view, use the Blade @verbatim@extends@endverbatim directive to specify which layout the view should "inherit". Views that extend a Blade layout may inject content into the layout's sections using @verbatim@section@endverbatim directives. Remember, as seen in the example above, these sections' contents will be displayed in the layout using @verbatim@yield@endverbatim:

// resources/views/example.blade.php

@section('title', 'Example Title')


    <p>This is appended to the default sidebar.</p>

    <p>This is the content.</p>


Partials are reusable views intended to be included in many other views and even within other partials. You can use any view as a "partial" by using the include directive.

// Import /resources/views/partials/assets.blade.php


Includes are like named slots that can be accessed outside of, and prior to, the view layer.

use Streams\Core\Support\Facades\Includes;

Includes::include('assets', 'partials.scripts');
@verbatim@foreach($includes->get('assets', []) as $include)
    @include $include


We recommend the following conventions as best practice.



Below is an excellent example of organizing utilitarian views like layouts and partials. These views are used for application structure and DRY'ing up views.

|-- partials/
|   |-- head.blade.php
|   |-- footer.blade.php
|   |-- navigation.blade.php
|-- layouts/
|   |-- amp.blade.php
|   |-- default.blade.php
|   |-- alternate.blade.php

Stream Views

Organizing stream views by stream can not only be automatically detected but bring order to large applications. You can even bundle stream specific partials and layouts within the stream directories to separate them from similar type views intended for global use, as shown above.

|-- contacts/
|   |-- index.blade.php
|   |-- view.blade.php
|   |-- vcard.blade.php

The above views correlate to the below routing example.

// streams/contacts.json
    "routes": {
        "index": "contacts",
        "view": "contacts/{id}",
        "vcard": "contacts/vcard/{id}"