Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tristanisginger's avatar

HTML forms Vs laravel-form-builder Vs Forms & HTML

Hi

I am looking at implementing a form builder and see there are two options available; Laravel Collective and kristijanhusak. What are peoples preferences or should I stick to HTML?

0 likes
11 replies
robrogers3's avatar

I really, really don't see the advantage of Form builders.

can some one explain the benefits of them?

it seems like a lot of hassle with not much gain.

5 likes
kobear's avatar

I am with @robrogers3. Maybe I am just old school, but I do not see the big advantage of having Form builders. Forms are easy enough to manage without all the extra baggage of builder code.

3 likes
Cronix's avatar

There's a reason why Laravel removed the HTML Form Builder from the Laravel core (which is what Laravel Collective Forms is), and it's pretty much what the above 2 people stated. They provide no real benefit, but seem to cause a lot of problems for people if you search through the forum. Just stick with HTML.

4 likes
robrogers3's avatar

ps. if the problem is it's a hassle creating the form html and such, use a snippet.

in laracasts jeffrey way does this a lot. must IDE's and editors support this?

@tristanisginger what's your editor?

1 like
tristanisginger's avatar

After years of Sublime I've recently started using PHPStorm and live templates thanks to Laracasts. Interestingly the live template example Jeffery uses in How to be a PHPstorm wizard is for a form builder text input!

I found using live templates and a form builder to create a blog post very quick.

I'll build my next form raw as all three answers I've had say avoid!

robrogers3's avatar

i have tons of snippets for forms.

try emmet too it works great.

1 like
Swaz's avatar

I find stuff like this to be pretty painful without.

Setting a default value when creating, and re-populating the value when editing:

HTML

@foreach($roles as $role)
    <div class="radio">
        <label>
            <input type="radio" name="role" value="{{ $role->id }}" 
                {{ old('role', $user->role_id) == $role->id ? 'checked' : '' }}
                {{ is_null($user->role_id) && $role->id == 1 ? 'checked' : '' }}
            >
            {{ $role->name }}
        </label>
    </div>
@endforeach

Form Builder

@foreach($roles as $role)
    <div class="radio">
        <label>
            {{ Form::radio('role', $role->id, 1) }}
            {{ $role->name }}
        </label>
    </div>
@endforeach
umefarooq's avatar

I really like and using Laravel Collective forms.

  1. you can extend Form or Html build can add more custom fields in Form or html builder, you can create twitter bootstrap form elements with extend.
  2. Form::model method help you fill all input fields with database save value on edit.
  3. or Form validation keeps old value in form element.
mecca6's avatar

We only stick to HTML forms because of future issues. For example, if we wanted to move an application from Laravel to another framework or we had to pass an application onto another company who don't use Laravel it would take a bit of time to refactor or change things

Please or to participate in this conversation.