Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5.1 form - 'files' => true

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 ?

like image 860
Aleks Per Avatar asked Feb 06 '23 05:02

Aleks Per


1 Answers

Your syntax is wrong. The following works for me:

{{Form::open(array('url' => 'your_url', 'method' => 'post', 'files' => true))}}
like image 170
Markinson Avatar answered Feb 10 '23 08:02

Markinson