Now we have to link the controller methods to the route. For this, add the following line to (web.php):

    1. Route::get('/customers', 'CustomerController@showCustomers');

    The controller name is separated from the method name with the @ character.

    By default, Laravel uses the blade template engine. The view function finds the necessary template in the resources/views directory, makes the necessary changes to it and returns the text of the HTML page, at the same time passing to it any variables that are supplied in the template. You can find the description of the blade template syntax at .

    The Template for Displaying Customers

    The template for displaying customers looks like this:

    1. @extends('example')
    2. @section('title', 'Customers')
    3. @section('body')
    4. <h1>Customers</h1>
    5. <p>
    6. {!! $filter !!}
    7. {!! $grid !!}

    This template is itself inherited from the master template and also enables the menu template. The menu is quite simple and consists of three items: Customers, Products and Invoices.

    1. <nav class="navbar main">
    2. <div class="navbar-header">
    3. <button type="button" class="navbar-toggle"
    4. data-toggle="collapse" data-target=".main-collapse">
    5. <span class="sr-only"></span>
    6. <span class="icon-bar"></span>
    7. <span class="icon-bar"></span>
    8. <span class="icon-bar"></span>
    9. </button>
    10. </div>
    11. <div class="collapse navbar-collapse main-collapse">
    12. <li @if (Request::is('customer*'))
    13. <li @if (Request::is('product*'))
    14. class="active"@endif>{!! link_to("products", "Products") !!}</li>
    15. <li @if (Request::is('invoice*'))
    16. class="active"@endif>{!! link_to("invoices", "Invoices") !!}</li>
    17. </ul>
    18. </div>
    19. </nav>

    The master template enables css styles and JavaScript files with libraries.

    1. @extends('example')
    2. @section('title', 'Edit customer')
    3. @section('body')
    4. <p>
    5. {!! $edit !!}