Answer the question
In order to leave comments, you need to log in
Why is the PUT method not supported even though it is specified in the form?
I don't understand what the problem is. I'm adding an entry. I get the error The PUT method is not supported for this route. Supported methods: POST. Everywhere they write about the token and the PUT method, but this does not solve the problem for me.
In the add post form, there is a hidden token and @method('PUT') There
are routes
Route::get('/call/create', '[email protected]')->name('create');
Route::post('/call/store', '[email protected]')->name('store');
The list of my routes looks like this
Form Submission:
{!! Form::open(['route' => 'admin.store']) !!}
@method('PUT')
<div class="form-group">
{!! Form::label('title') !!}
{!! Form::text('title', null, ['class'=>'form-control'] ) !!}
<div>
<div class="form-group">
{!! Form::submit('Create', ['class'=>'btn btn-primary']) !!}
<div>
{!! Form::close()!!}
class CallController extends Controller {
public function index()
{
$call = Call::all();
return view('backend.call.index', ['call' => $call]);
}
public function create()
{
return view('backend.call.create');
}
public function store(Request $request)
{
print($request);
}
}
Answer the question
In order to leave comments, you need to log in
Removed @method('PUT') in the add form and the entry was added.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question