LoginSignup
1
1

More than 5 years have passed since last update.

Laravel フォーム周りのエラー Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException

Posted at

こんな感じのエラーが出る。


\Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException
\vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php

    /**
     * Throw a method not allowed HTTP exception.
     *
     * @param  array  $others
     * @return void
     *
     * @throws \Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException
     */
    protected function methodNotAllowed(array $others)
    {
        throw new MethodNotAllowedHttpException($others);
    }

    /**
     * Get routes from the collection by method.
     *
     * @param  string|null  $method
     * @return array
     */
    public function get($method = null)
    {
        return is_null($method) ? $this->getRoutes() : Arr::get($this->routes, $method, []);
    }

結論として


{{ csrf_field() }}

とフォームの中に書くとよい。
わかんなくてはまりました。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1