There is no license information available for the latest version (dev-master) of this package.

dev-master 2014-12-30 13:54 UTC

This package is not auto-updated.

Last update: 2024-02-27 05:52:09 UTC


A helper library that includes methods for generating the HTML for labels, select fields, text fields, links, and tables.


With Composer

Add the following to your composer.json then run composer install

    "require": {
        "indatus/widgets": "dev-master"

Register the service provider in app/config/app.php

    'providers' => array(

Widget Gallery


Tables can be created from multi-dimentional arrays. The keys will serve as the titles to be displayed in the table header. Additional options may be passed in the options parameter to be applied to the table element.

Data in controller passed to the view.

    $data = [
        ['name' => 'Alex', 'occupation' => 'Engineer'],
        ['name' => 'Judy', 'occupation' => 'Analyst'],
        ['name' => 'Pam', 'occupation' => 'Coach']
    $options = ['class' => 'table'];

Using the table generator inside of the blade template.

    {{ Indatus\Widgets\Table::generate($data, $options) }}

The resulting HTML.

    <table class="table">


Data in controller passed to the view.

    $select = [
        'Red' => 1,
        'Orange' => 2,
        'Yellow' => 3,
        'Green' => 4,
        'Blue' => 5,
        'Indigio' => 6,
        'Violet' => 7
    $selected = 5; // Used to set what option will be selected.

Using the select generator inside of the blade template.

{{ Indatus\Widgets\Select::generate($select, $selected) }}

The resulting HTML

            <option value="1">Red</option>
            <option value="2">Orange</option>
            <option value="3">Yellow</option>
            <option value="4">Green</option>
            <option value="5" selected="">Blue</option>
            <option value="6">Indigio</option>
            <option value="7">Violet</option>

Label and Input

Using the label and input generator inside of the blade template.

    {{ Indatus\Widgets\Label::generate('Email', 'email', ['class' => 'loud']) }}
    {{ Indatus\Widgets\TextField::generate('email', null, ['class' => 'email']) }}
    {{ Indatus\Widgets\TextField::generate('name', 'Steve') }}

The resulting HTML

    <label for="email" class="loud">Email</label>
    <input type="text" name="email" id="email" class="email">
    <input type="text" name="name" id="name" value="Steve">


Using the link generator inside of the blade template.

    {{ Indatus\Widgets\Link::generate('Google', '', ['class' => 'outbound']) }}

The resulting HTML

    <a href="" class="outbound">Google</a>


To publish this package's assets to run the artisan publish command targeting this package.

    php artisan asset:publish indatus/widgets 

Then to include the assets use the following inside of your templates

    {{ Indatus\Widgets\Asset::scripts() }}
    {{ Indatus\Widgets\Asset::styles() }}

The resulting HTML

    <script src=""></script>
    <link rel="stylesheet" href="">