PHP code example of kgrzelak / laravel-form

1. Go to this page and download the library: Download kgrzelak/laravel-form 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/ */

    

kgrzelak / laravel-form example snippets


Form::input()
    ->name('input-name')
    ->type('text')
    ->value('input-value')
    ->placeholder('input-placeholder')
    ->setClass('form-control')
    ->addClass('mt-5')
    ->attribute('readonly', 'readonly')
    ->attribute('

Form::textarea()
    ->name('textarea-name')
    ->value('textarea-value')
    ->placeholder('textarea-placeholder')
    ->setClass('form-control')
    ->addClass('mt-5')
    ->attribute('readonly', 'readonly')
    ->attribute('

Form::select()
    ->name('select-name')
    ->setOptions([
        'option-value-1' => 'option-label-1',
        'option-value-2' => 'option-label-2',
        'option-value-3' => 'option-label-3',
    ])
    ->addOption('option-value-4', 'option-label-4')
    ->value('option-value-2')
    ->setClass('form-control')
    ->addClass('mt-5')
    ->attribute('readonly', 'readonly')
    ->attribute('
bash
php artisan vendor:publish --provider="Kgrzelak\LaravelForm\LaravelFormServiceProvider"