Skip to content

wdda/laravel-uikit-form

Repository files navigation

Laravel Uikit Form

Software License

Small and smart package for generate html form elements as Uikit mark!

Example

Input:

{!! formInput('my_name')->value('value 123')->class('uk-input') !!}

Result:

<div class="uk-margin-small-bottom">
   <label @if($id)for="{{ $id }}"@endif>{{ $label }}</label>
   <div class="uk-form-controls">
       <input @if(!$class)class="uk-input" @endif
           @if($id)id="{{ $id }}" @endif
           @if($name)name="{{ $name }}" @endif
           value="{{ $value }}"{!! $attributes !!}>
   </div>
</div>
formInput('Input')
    ->label('Input')
    ->id('id')
    ->class('uk-input')
    ->attributes(['attribute1', 'attribute2' => 'value'])
    ->value('value')
formTextarea('Textarea')
    ->label('Textarea')
    ->id('id')
    ->class('uk-input')
    ->attributes(['attribute1', 'attribute2' => 'value'])
    ->value('value')
    ->rows(8)
formSelect('Select')
    ->label('Select')
    ->id('id')
    ->class('uk-input')
    ->attributes(['attribute1', 'attribute2' => 'value'])
    ->value('value')
formCheckbox('Checkbox')
    ->label('Checkbox')
    ->id('id')
    ->class('uk-input')
    ->attributes(['attribute1', 'attribute2' => 'value'])
    ->value('value')
formRadio('Radio')
    ->label('Radio')
    ->id('id')
    ->class('uk-input')
    ->attributes(['attribute1', 'attribute2' => 'value'])
    ->value('value')

Install

Install package:

$ composer require wdda/laravel-uikit-form

Update package

$ composer update wdda/laravel-uikit-form

Open your config/app.php and add the following to the providers array:

WDDA\LaravelUikitForm\LaravelUikitFormProvider::class,

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.