title: How to print table data in Laravel 5.6?
body: <p>in My Larvel 5.6 app I am working with mysql db. and in my application I have vehicle table with following columns,
  vehicles,</p>
  
  <pre><code>id  category  number  brand model
  1   car       123     bmw   520d
  2   van       258     ford  mark
  3   car       256     benz  ultra
  4   car       259     bmw   520d
  etc
  </code></pre>
  
  <p>and I am going to group all models of the table and printing here as My controller,</p>
  
  <pre><code>public function modelstatic()
  {
        $models = Vehicle::groupBy('modelname')-&gt;select('id', 'modelname', \DB::raw('COUNT(*) as cnt'))-&gt;get();  
        return view('modelreports.modelstatic')-&gt;withModels($models);
  }
  </code></pre>
  
  <p>my printing blade file is this,</p>
  
  <pre><code>@foreach($models as $model)
       {{ $model-&gt;modelname }}
  @endforeach
  </code></pre>
  
  <p>it is printing well as</p>
  
  <pre><code>520d
  mark
  ultra
  </code></pre>
  
  <p>now I need print in-front of model name there brand name as</p>
  
  <pre><code>520d - bmw
  mark - ford
  ultra - benz
  </code></pre>
  
  <p>Then how can I do this now? I have separate Models for brand and model and still there are not relationship between Models. how can I do this, may I need relationship or may I could print brand name via vehicle table data?</p>