Use Laravel Forms with Bootstrap 4 Components

Maintainers

Details

github.com/maksuco/b4c

Source

Issues

Installs: 22

Dependents: 0

Suggesters: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:laravel

v1.0.5 2017-09-28 16:42 UTC

README

This package helps you render bootstrap 4 components inside blade.

Installation

You can install the package via composer:

$ composer require maksuco/b4c
OR
$ composer require maksuco/b4c:dev-master

This Package works with autodiscovery in Laravel +5.5, but is compatible with older versions

Usage

Render text inputs:


  {!! \B4C::text($name,$label,$value,$attributes,$extra,$version) !!}
  //formtext('video','Video',$property->video,['placeholder' => 'Video code'],'required','form-group-default')

Render Textarea inputs:


  {!! \B4C::textarea($name,$label,$value,$attributes,$version) !!}
  //formtextarea('video','Video',$property->video,['css' => 'color-primary'],'')

Render file inputs:


  {!! \B4C::file($name,$label,$attributes,$extra,$version) !!}
  //formfile('floorplan',__('Floor Plan'),['class' => 'mt-5','accept' => '.jpg,.jpeg,.png,.pdf'],'required','')

Render select inputs:


  {!! \B4C::select($name,$label,$value,$options,$first,$attributes,$extra,$version) !!}
  //formselect('zone',__('zone'),$property->zone,['N','E','W','S','NE','NW','SE','SW'],'Choose one',['class' => 'h-20'],'','')

Render checkbox inputs:


  {!! \B4C::check($name,$label,$value,$extra,'disabled') !!}
  //formswitch('show',__('Show'),1)

Render switch inputs:


  {!! \B4C::switch($name,$label,$value,$extra,'') !!}
  //formswitch('show',__('Show'),$item->show)

Render Radio inputs:


  {!! \B4C::radio($name,$label,$value,$extra,'') !!}

Render text/switch inputs:


  {!! \B4C::textswitch($name,$label,$value,$attributes,$switch_name,$switch_value) !!}
  //formtext('video','Video',$property->video,['placeholder' => 'Video code'],'video_on',$property->video_on)

Security

If you discover any security related issues, please report it.

Credits

License

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