2017-12-23 20 views
0

Ich habe folgendes: {!! Form::model($houses, ['method' => 'PATCH','route' => ['houses.update', $houses->id]]) !!}Laravel 5.5 Erstellformular id

und {!! Form::open(array('route' => 'houses.store','method'=>'POST')) !!}

Hexe Ergebnis in: <form method="POST" action="http://localhost/j/public_html/houses/2" accept-charset="UTF-8">

und <form method="POST" action="http://localhost/j/public_html/houses" accept-charset="UTF-8">

Wie füge ich eine <form id="houseform" ... in beiden Sie??

Dank

Antwort

1

Sie verwenden können:

{!! Form::model($houses, [ 
      'method' => 'PATCH', 
      'route' => ['houses.update', $houses->id], 
      'id' => 'houseform' 
    ]) !!} 

Ähnliche für die 2.:

{!! Form::open(array('route' => 'houses.store','method'=>'POST', 'id' => 'houseform')) !!} 
+0

Dank @Marcin, ich war so etwas wie '' 'falsch versucht {!! Form :: model ($ houses, ['methode' => 'PATCH', 'route' => ['houses.update', $ houses-> id]]), 'id' => 'houseform' !!} '' 'Es funktioniert jetzt! – Diego