B
B
BonBon Slick2016-11-06 15:05:18
Apache HTTP Server
BonBon Slick, 2016-11-06 15:05:18

Route::patch throws MethodNotAllowedHttpException?

Doing an update of the record

Route::patch( 'product/{id}', '[email protected]' );

Controller
public function update(Request $request, $product_id)
   {
    $product = Product::find($product_id);
    return $request->all();
}

HTML
<form action="/product/{{ $product->product_id }}" method="patch"> //post пробовал
  {{ csrf_field() }}
inputs....
</form>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hakkol, 2016-11-06
@BonBonSlick

The form is missing code:
{{ method_field('PATCH') }}

T
Tesla, 2016-11-06
@Tesla

Because read the documentation .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question