PHP code example of core-system / bootstrap-form

1. Go to this page and download the library: Download core-system/bootstrap-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/ */

    

core-system / bootstrap-form example snippets

 
Core\BootstrapForm\BootstrapFormServiceProvider::class 

'Form' => Collective\Html\FormFacade::class

Form::open(array $options = [])

Form::close()

Form::openGroup(string $name, mixed $label = null, array $options = [])

Form::closeGroup()

Form::input(string $type, string $name, mixed $value = null, array $options = [])

Form::select(string $name, array $list = [], mixed $selected, array $selectAttributes = [], array $optionsAttributes = [])

Form::plainInput(string $type, string $name, mixed $value = null, array $options = [])

Form::plainSelect(string $name, array $list = [], mixed $selected, array $selectAttributes = [], array $optionsAttributes = [])

Form::checkbox(string $name, mixed $value = 1, mixed $label = null, bool $checked = null, array $options = [])

Form::radio(string $name, mixed $value = null, mixed $label = null, bool $checked = null, array $options = [])

Form::inlineCheckbox(string $name, mixed $value = 1, mixed $label = null, bool $checked = null, array $options = [])

Form::inlineRadio(string $name, mixed $value = null, mixed $label = null, bool $checked = null, array $options = [])

Form::textarea(string $name, mixed $value = null, array $options = [])

Form::plainTextarea(string $name, mixed $value = null, array $options = [])

{!! Form::open(['class' => 'form', 'id' => 'loginForm', 'url' => route('backend.auth.login')]) !!}
    {!! Form::openGroup('email', null, ['class' => 'has-feedback']) !!}
        {!! Form::text('email', null, ['placeholder' => trans('auth.email-placeholder') ]) !!}
    {!! Form::closeGroup() !!}
    {!! Form::openGroup('password', null, ['class' => 'has-feedback']) !!}
        {!! Form::password('password', ['placeholder' => trans('auth.password-placeholder') ]) !!}
    {!! Form::closeGroup() !!}
    {!! Form::openGroup('submit', null) !!}
        {!! Form::input('submit', 'submit', trans('auth.login'), ['class' => 'btn btn-primary btn-lg']) !!}
    {!! Form::closeGroup() !!}
{!! Form::close() !!}

namespace App\Http\Requests;

use App\Http\Requests\Request;

class LoginFormRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'email' => '
 
namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Http\Requests\LoginFormRequest;

class FormsController extends Controller
{
    /**
     * Example action to handle login form POST action
     *
     * @return void
     */     
    public function login(LoginFormRequest $request)
    {
        // your next logical code
    }
}