Laravel form html with PUT method for PUT routes

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

I Have this in my routes :

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


        
6条回答
  •  情书的邮戳
    2020-12-05 23:41

    in your view blade change to

    {{ Form::open(['action' => 'postcontroller@edit', 'method' => 'PUT', 'class' = 'your class here']) }}
    
    
    {{ Form::textarea('textareanamehere', 'default value here', ['placeholder' => 'your place holder here', 'class' => 'your class here']) }}
    {{ Form::submit('Update', ['class' => 'btn class here'])}}
    {{ Form::close() }}

    actually you can use raw form like your question. but i dont recomended it. dan itulah salah satu alasan agan belajar framework, simple, dan cepat. so kenapa pake raw form kalo ada yang lebih mudah. hehe. proud to be indonesian.

    reference: Laravel Blade Form

提交回复
热议问题