PHP Tutorial - Laravel 5.1 - How to load content from database for Master Page

I'm making an administrable website in Laravel. I have a custom class that loads the content of a page / widget from a database and returns HTML.
/**
 * Loads a page content from the database
 * 
 * @param Id of the page, it can be a number or class constant
 * @return html
 */
public function pageContent($id)
{
    $content = DB::table('pages')->where('id', '=', $id)->first();
    return $content->content;
}
Let's say the website administrator put in that page something like:
"All Rights reserved, blablabla 2015, Contact Us: 488 889 77 88"
And I want it to appear in the website footer. Some of my master page code is.
<body>

    @include('layouts.mainmenu')

    @yield('body')

    <div class="footer">
        {{ I WANT TO HAVE THE FOOTER FROM THE DATABASE HERE! }}
    </div>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script src="{{ asset('js/bootstrap.min.js') }}"></script>
    <script src="{{ asset('js/main.js') }}"></script>

    @yield('bottom-js')

</body>


Answer:

If your function is inside your HomeController
HomeController:
  public function pageContent($id)
 {
   $content = DB::table('pages')->where('id', '=', $id)->first();
   return $content;
  }

  public function index()
  {
    $content = $this->pageContent();
    return view('your_master_blade', compact('content'));
  }
View inside your master blade:
<body>

@include('layouts.mainmenu')

@yield('body')

<div class="footer">
    @foreach($content as $cont)
       {{$cont->id}}
         //so on and so forth
    @endforeach
    {{ I WANT TO HAVE THE FOOTER FROM THE DATABASE HERE! }}
</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="{{ asset('js/bootstrap.min.js') }}"></script>
<script src="{{ asset('js/main.js') }}"></script>

@yield('bottom-js')