PHP code example of grohiro / laravel-blade-macro

1. Go to this page and download the library: Download grohiro/laravel-blade-macro library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

grohiro / laravel-blade-macro example snippets


$providers = [
  // 
  Grohiro\LaravelBladeMacro\BladeMacroServiceProvider::class,
];

@macro('bootstrap_input', $type, $field, $label = "", $opts = ['class' => 'form-control'])
<div class="form-group">
  <label class="col-sm-1 control-label">{{$label}}</label>
  <div class="col-sm-8">
    {!! Form::$type($field, '', $opts) !!}
  </div>
</div>
@endmacro

{!! Html::bootstrap_input('text', 'username', 'Username') !!}
{!! Html::bootstrap_input('text', 'email', 'E-Mail', ['