Laravel form html with PUT method for PUT routes

后端 未结 6 1037
庸人自扰
庸人自扰 2020-12-05 23:09

I Have this in my routes :

+--------+---------------------------+--------------+---------------------------                                                           


        
6条回答
  •  庸人自扰
    2020-12-05 23:45

    You CAN add css clases, and any type of attributes you need to blade template, try this:

    {{ Form::open(array('url' => '/', 'method' => 'PUT', 'class'=>'col-md-12')) }}
    .... wathever code here
    {{ Form::close() }}
    

    If you dont want to go the blade way you can add a hidden input. This is the form Laravel does, any way:

    Note: Since HTML forms only support POST and GET, PUT and DELETE methods will be spoofed by automatically adding a _method hidden field to your form. (Laravel docs)

提交回复
热议问题