Form maker for Laravel inspired by Laravel form builder. With the help of Form Maker views, forms can be modified and reused easily. You can pass style, values, types to the helpers.
- Style - Pass style to the helper to customize element
- Value - Pass value to the helper to get the data from the particular field
- Type - Set the type of the input field such as email, number, tel etc.
- Active - Active the desired radio button or select field.
- Required - Handle the required field of the form
Via Composer
$ composer require mashfiqdev/form_makerIf you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php
\MashfiqDev\FormMaker\FormMakerServiceProvider::class,You can use this in your blade file to make your form.
You have to store the style containing classes, value, type, id, name in a variable like this:
$emaildata = [
"ids" => ["email"],
"classes" => ["form-control", "bg-light","my-2"],
"type" => "email",
"name" => "email",
"values" => [
"prev_value" => "mashfiqurrr@gmail.com"
],
"required" => true
];And include the HTML input element like this:
<div class="form-group">
<label for="name">Email</label>
@include('FormElement::input', ['data' => $emaildata])
</div>You have to store the style containing classes, value, id, name, active field, required status in a variable like this:
$countrydata = [
"ids" => ["country"],
"classes" => ["form-select", "bg-light","my-2"],
"name" => "country",
"values" => [
"BD" => "Bangladesh",
"AUS" => "Australia",
"DU" => "Germany",
"CN" => "Canada",
],
"active" => "DU",
"required" => true
];And include the HTML input element like this:
<div class="form-group">
<label for="country">Country</label>
@include('FormElement::select', ['data' => $countrydata])
</div>You have to store the style containing classes, value, id, name, active field, required status in a variable like this:
$degreedata = [
"ids" => ["degree"],
"classes" => ["py-2", "bg-light","my-2","blockquote"],
"name" => "degree",
"values" => [
"psc" => "P.S.C",
"jsc" => "J.S.C",
"ssc" => "S.S.C",
"hsc" => "H.S.C",
"bsc" => "B.S.C",
"msc" => "M.S.C",
],
"required" => true
];And include the HTML input element like this:
<div class="form-group">
<label for="country">Degree</label>
@include('FormElement::checkbox', ['data' => $degreedata])
</div>You have to store the style containing classes, value, id, name, active field, required status in a variable like this:
$maritaldata = [
"ids" => ["marital"],
"classes" => ["form-check","form-check-inline", "bg-light","my-2","blockquote"],
"name" => "marital",
"values" => [
"single" => "Single",
"married" => "Married",
"unmarried" => "Unmarried"
],
"active" => "unmarried",
"required" => true
];And include the HTML input element like this:
<div class="form-group">
<label for="country">Marital Status</label><br>
@include('FormElement::radio', ['data' => $maritaldata])
</div><div class="container py-5 mt-5 card col-md-6 offset-3">
<h1 class="text-center">Sign Up</h1>
<form>
<div class="form-group">
<label for="name">Email</label>
@include('FormElement::input', ['data' => $emaildata])
</div>
<div class="form-group">
<label for="country">Country</label>
@include('FormElement::select', ['data' => $countrydata])
</div>
<div class="form-group">
<label for="country">Degree</label>
@include('FormElement::checkbox', ['data' => $degreedata])
</div>
<div class="form-group">
<label for="country">Marital Status</label><br>
@include('FormElement::radio', ['data' => $maritaldata])
</div>
<button type="submit" class="btn btn-primary" disabled>Submit</button>
</form>
</div>If you discover any security related issues, please email mashfiqurrr@gmail.com instead of using the issue tracker.