I'm having a little bit of trouble returning data on a return view()->with();
statement.
The error I'm getting is just a blank screen with the default laravel auth navigation bar.
The MySQL table structure:
id | version | active | slug
Here is my code for you to look at.
Function
function index() {
$changelogs = Changelogs::where('active', '1')->orderBy('created_at', 'desc');
return view('changelog.index')->with('changelogs', $changelogs);
}
Route (Incase you need it)
Route::get('/release-notes', 'Changelogs\MyController@index');
View
@foreach($changelogs as $changelog)
<div class="row">
div class="col-md-10 col-md-offset-1">
div class="panel panel-default">
<div class="panel-heading">
<h3><a href="{{ url('/release-notes/'.$changelog->slug) }}">{{ $changelog->version }}</a></h3>
</div>
<div class="panel-body">
{!! $changelog->body !!}
</div>
</div>
</div>
</div>
@endforeach