S
S
Sasha Ermolaev2020-02-04 11:24:31
Laravel
Sasha Ermolaev, 2020-02-04 11:24:31

The POST method is not supported for this route. Supported methods: GET, HEAD, what could be the problem?

I started learning Laravel and ran into a problem I can't pass data from the form

routes: form:
Route::post('reg', '[email protected]');

<form class="needs-validation" method="post" novalidate action="reg">

      <h4 class="mb-3">Регистрация клиента</h4>

      <div class="col-md-6 mb-3">
        <label for="fio">ФИО</label>
        <input type="text" class="form-control" name="fio" id="fio" placeholder="" value="" required>
        <div class="invalid-feedback">
          Пожалуйста, введите ФИO.
        </div>
      </div>
<button class="btn btn-primary btn-lg btn-block col-md-6 mb-3" type="submit">Зарегистрировать</button>
      </form>


controller:
class regController extends Controller
{
    public function regClient(Request $request){

      $name = $request->get("fio");
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Northern Lights, 2020-02-04
@Ermolaev_eb

patch instead of post

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question