Reputation: 622
I have a simple method that passes info to a view:
Route::get('/', function () {
$thissite = DB::table('this_site')->where('id',1)->get();
$slider1 = DB::table('front_sliders')->where('active',1)->take(10)->get();
return view('index')->with('slider1',$slider1)->with('site', $thissite );
});
All the data is passed OK and the $thissite is just one record, with one of the fields being called headline.
My problem is outputting this single variable along the lines of:
<h1><strong>{{ headline }}</strong></h1>
I have tried many variations on this but I am not getting anywhere!
Upvotes: 0
Views: 23
Reputation: 13325
So headline
is a column in this_site
? If so then the this should work:
<h1><strong>{{ $site->headline }}</strong></h1>
Upvotes: 1