Reputation: 1639
I use Laravel HTML to create form but I have problem, so in creating form I have:
{!! Form::open(['url'=>'vocuhers','files' => 'true','enctype'=>'multipart/form-data']) !!}
@include('vouchers.form',['submitButtonText'=>'Click to Add New Vocuher'])
{!! Form::close() !!}
But when I see my HTML form in browser there is just:
<form method="POST" action="http://localhost:8888/vouchers" accept-charset="UTF-8">
<input name="_token" type="hidden" value="dfgdfgdfgdfgdf">
so where is
enctype="multipart/form-data"
which allow me to upload files from form ?
Why I don't get this HTML output:
<form method="POST" action="https://bedbids.com/chats" accept-charset="UTF-8" enctype="multipart/form-data">
<input name="_token" type="hidden" value="dsfdfgdfgdfgdfg">
What is the problem here exactly ?
Upvotes: 4
Views: 15515
Reputation: 1
Change it to like this:
{!! Form::attributes(['enctype'=>"multipart/form-data"])open(['url'=>'vocuhers']) !!}
Upvotes: 0
Reputation: 41
{!! Form::open(['url'=>'vocuhers','files' => 'true','enctype'=>'multipart/form-data']) !!}
change It to
{!! Form::open(['url'=>'vocuhers','files' =>true,'enctype'=>'multipart/form-data']) !!}
as Markinson said
Upvotes: 0
Reputation: 6539
Change url
with route
as below.
{{!! Form::open(['route'=>'vocuhers','class'=>'your_class','files'=>true]) !!}}
Upvotes: 2
Reputation: 2182
Your syntax is wrong. The following works for me:
{{Form::open(array('url' => 'your_url', 'method' => 'post', 'files' => true))}}
Upvotes: 7