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

Tachi's avatar
Level 1

What is the best way to build form in Laravel 5.4?

I couldn't find documentation about building form with Laravel methods in 5.4. I found method:

{!! Form::open(['url' => url('admin/articles/save')]) !!}
{{!! Form::close() !!}}

But it's not working properly if I just paste it my blade view.

Any tips on how to properly initialize form to send data in laravel 5.4?

0 likes
11 replies
RonB1985's avatar

You will need to pull in this package first:

https://laravelcollective.com/docs/5.2/html

Then the above will work properly.

PS. The Form close tag should be either this:

{!! Form::close() !!}

Or this:

{{ Form::close() }}

The former should be fine for this though.

1 like
Tachi's avatar
Level 1

Well, the above is not official part of Laravel 5.4, I would like to use something that is official and is maintained.

martinbean's avatar

@Tachi You syntax you’re using above was removed in an earlier version of Laravel. It was kept alive, but as a third-party package: https://github.com/LaravelCollective/html

If you want to use those helpers, you’ll need to install the package. Also, you can just use the normal Blade syntax, i.e.

{{ Form::open(['url' => 'admin/articles/save']) }}
{{ Form::close() }}

A lot of people say not to use this package as it’s an extra, unnecessary abstraction layer. However, I personally use it in nearly all Laravel projects I work on.

1 like
Jaytee's avatar

There isn't anything official. Collective is maintained.

But, i've seen many people move away from form builders and stick to plain html. Sure, some form builders allow you to be more productive but it's not as descriptive as the html markup itself.

Either go with Collective, see tomi's article or stick with plain HTML.

3 likes
DarkRoast's avatar

I don't think it adds anything over using html. I find this much more readable:

<form method="get" action="{{ route('some.named.route') }}">
{!! csrf_field() !!}
<input type="text" name="title" value="{{ old('title') }}" />
</form>
5 likes
shez1983's avatar

but if you use bootstrap or anything like that, your code gets messy.. and at that point you should try to abstract the fields to a function (blade helper) or something..

1 like
irsyadadl's avatar

Actually why laravel itselft does not provide the form builder.

Please or to participate in this conversation.