I am not able to pass database info to my blade file. I want to display all database entries on one page. What am I doing wrong?
diary.blade.php
@foreach($posts as $post)
<Tr>
<th></th>
<th></th>
</Tr>
@endforeach
web.php
Route::get('diary', 'DiaryController@index')->name('diary');
DiaryController.php
public function index()
{
$posts = DB::table('entries')->get();
return view ('user.diary')->with('diary', $posts);
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire