title: footer query data from db show in master.blade laravel 5.4
body: <p>I need to query information form database <code>[company name ,company address]</code>
  and my code can show 1 page </p>
  
  <p>my controller</p>
  
  <pre><code>public function index()
  {
      $footer = DB::table('pjt_setting')-&gt;pluck('value','setting_name')-&gt;toArray();
      //dd($footer);
      return view('frontend.index',compact('footer'));
  }
  </code></pre>
  
  <p>Master blade</p>
  
  <pre><code>&lt;!-- topbar --&gt;
  @include('frontend.layouts.topbar')
  &lt;!-- top --&gt;
  @include('frontend.layouts.nav')
  &lt;!-- header slide --&gt;
  &lt;!-- Main content --&gt;
      @yield('content')
  &lt;!-- /.content --&gt;
  &lt;footer class="footer-distributed"&gt;
      @include('frontend.layouts.footer')
  &lt;/footer&gt;
  </code></pre>
  
  <p>Footer blade</p>
  
  <pre><code>&lt;div class="row"&gt;
  &lt;div class="col-md-6"&gt;
      &lt;div class="footer-left"&gt;
          &lt;h3&gt;{{ $footer["companyname"]}}&lt;/h3&gt;
          &lt;p class="footer-company-name"&gt;Phuket Jet Tour &amp;copy; 2018&lt;/p&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="footer-center"&gt;&lt;/div&gt;
  &lt;div class="col-md-6"&gt;
      &lt;div class="footer-right"&gt;
          &lt;div class="companyaddress"&gt;
              &lt;i class="fa fa-map-marker"&gt;&lt;/i&gt;
              &lt;p&gt;{{ $footer["companyaddress"] }}&lt;/p&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;i class="fa fa-phone"&gt;&lt;/i&gt;
              &lt;p&gt;{{ $footer["phone"] }}&lt;/p&gt;
          &lt;/div&gt;
          &lt;div&gt;
              &lt;i class="fa fa-envelope"&gt;&lt;/i&gt;
              &lt;p&gt;&lt;a href="mailto:{{ $footer["email"] }}"&gt;{{ $footer["email"] }}&lt;/a&gt;&lt;/p&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>Index page no problem but, I link to contact page 
  show error <code>"Undefined variable:footer"</code>.
  How I can edit </p>