-1

I'm learning how to work with forms but I got an error on the first try when I tried simple html code.

<form class="form" method="post" action="{{url('/painel/produtos/store')}}">

With this code I got this error:

MethodNotAllowedHttpException in RouteCollection.php line 218:

So I searched around and find out that people use this code instead

{{ Form::open(array('url' => '/painel/produtos/store')) }}

And I got a new error which is Class 'Form' not found so i searched and found that I would need Laravel Collective but when I try to install it it gives me this error:

  [UnexpectedValueException]
  Could not parse version constraint :5.3.0: Invalid version string ":5.3.0"

So I dont know what to do more.

  • Can you share the edit you made to your `composer.json`? – Nico Haase Apr 07 '18 at 10:10
  • I didn't made any edit on composer.json – Xavier Nabais Apr 07 '18 at 15:02
  • And where did you get that error message about that version constraint? You tagged your question with `composer-php`, so I assumed there would be a problem with installing a package – Nico Haase Apr 08 '18 at 08:06
  • But reading your post a second time, I think you got the method restriction wrong. Have a look at https://symfony.com/doc/current/routing/requirements.html#adding-http-method-requirements – Nico Haase Apr 08 '18 at 08:07
  • This is the right code to use: `{!! Form::open(['url' => '/painel/produtos/store']) !!}` – lewis4u Apr 08 '18 at 16:06

1 Answers1

-1

Hello you can try this.

But the project has abandoned.

composer require "laravelcollective/html"::"^5.3.0"

  • Hi Gabriel, welcome to stackoverflow. Can you explain in your answer in more detail what that line of code does, where it belongs, and how it answers the original question? – cronburg May 16 '19 at 23:05