を、私はこのエラーを取得しています:UrlGenerationException:[:topics.updateルート]のために必要なパラメータの欠落[URI:トピック/ {トピック}]
Missing required parameters for [Route: topics.update] [URI: topics/{topic}]. (View: C:\xampp\htdocs\phpboards\resources\views\topics\edit.blade.php)
これは、編集するユーザーを取るのリンクです。
<a href="/boards/topics/edit/{{$topic->id}}" class="btn btn-default">Edit</a>
これは、編集用のコントローラです:
$topic = Topic::find($id);
return view('topics.edit')->with('topic', $topic);
これがルートである:
Route::get('/boards/topics/edit/{id}', '[email protected]');
これは、編集するためのフォームです:私はここで間違って行っている
<div class="container">
{!! Form::open(['action' => '[email protected]', 'method' => 'POST']) !!}
<div class="form-group">
{{ Form::label('title', 'Title') }}
{{ Form::text('title', $topic->topic_title, ['class' => 'form-control', 'placeholder' => 'Title of the Post']) }}
</div>
<div class="form-group">
{{ Form::label('desc', 'Desc') }}
{{ Form::textarea('desc', $topic->topic_body, ['class' => 'form-control', 'placeholder' => 'Description of the Post']) }}
</div>
{{ Form::submit('Submit', ['class' => 'btn btn-default']) }}
{!! Form::close() !!}
</div>
何?
@ParantapParasharしかし、何のために??どのコントローラのために? –
コードには非常に多くのエラーがあります。 –
私はここにあなたの更新メソッドとRouteを置く必要があると思います。 –