、このような何かを行います。ドキュメントで正しい方法を探します(https://laravel.com/docs/5.4/eloquent#retrieving-models)。たとえば、あなたはすべての入力をしたい場合は、あなたがInput::all();
をするだろう、代わりのInput::where('editorcontents')->get();
public function index() {
$content = Input::where('editorcontents')->get();
return view('your_view.blade.file', compact('content'));
}
その後、あなたのビューであなたは今、あなたのコントローラから渡されたことを、$content
を持っているでしょう。
開始から見ると、視点の最上部にこれを追加します:{{ dd($content) }}
。これはdie dump $content
になります。
先に行くと、その行を削除し、(ドキュメントここではhttps://laravel.com/docs/5.4/blade#loops)のような何かを:
<div id="editorcontents" name="editorcontents">
@forelse ($content as $value)
<li>{{ $value->body }}</li>
@empty
<p>No content</p>
@endforelse
</div>