- Kategoriler
-
Başlıklar
Array ( [0] =>
[1] => <input type="hidden" name="_method" value"PUT"> ) Array ( [0] =><input type="hidden" name="_method" value"PUT">
[1] => <form action="" method="post"> @method('PUT') ... </form> )<form action="" method="post"> @method('PUT') ... </form>
-
Paylaş
Array
(
[0] =>
<input type="hidden" name="_method" value"PUT">
[1] => <input type="hidden" name="_method" value"PUT">
)
Array
(
[0] => <form action="" method="post">
@method('PUT')
...
</form>
[1] => <form action="" method="post">
@method('PUT')
...
</form>
)
Laravel @method Direktifi
HTML formlarında PUT, PATH ve DELETE metodları tanımlandığı için form içerisinde _method
olarak metodu tanımlamanız gerekiyor. Bu direktifi kullanmadan yapacak olsaydık şöyle yapmamız gerekirdi;
<input type="hidden" name="_method" value"PUT">
Ancak bunun yerine bu direktifi form içinde şu şekilde kullanmamız yeterli olacaktır.
<form action="" method="post">
@method('PUT')
...
</form>
Ayrıca bkz: @csrf