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);
}
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2iEj35P
via IFTTT
Aucun commentaire:
Enregistrer un commentaire