I have a header.blade.php in an includes folder, this header page is the whole webpage base. i have links on it and i have the header of the website which is included in all other web pages.
The heading part i want to retrive just the first line of the table result in it so the admin can update that line whenever possible.
The thing is that it is hard to figure out a route to give to it as it is a partial page.
The code on it is:
<div class="site-heading" data-webid="{{ $web_header->id }}>
<h1>{{ $web_header->header }}</h1>
<hr class="small">
<span class="subheading">{{ $web_header->slogan }}</span>
</div>
My home controller has the following code to display in the information on the header partial page:
public function showWebHeader()
{
$web_header = WebHeader::all()->first();
return view('include/header', [
'web_header' => $web_header
]);
}
I am lost and confused here because I keep getting undefined variable on every single page I have on my web system.