title: Laravel 5.4 relationships with all()
body: <p>I have two tables, <strong>QA</strong> and <strong>QACategories</strong>.</p>
  
  <p>QA has the usual fields (increment etc) and also a field <strong>category_id</strong>.</p>
  
  <p>QA categories has the usual plus a field "category".</p>
  
  <p>The model for QA is:</p>
  
  <pre><code>class QandA extends Model
  {
       protected $table = 'qa';
  
       public function category()
      {
          return $this-&gt;hasOne('QACategories::class');
      }
  }
  </code></pre>
  
  <p>and the QACategories is</p>
  
  <pre><code>class QACategories extends Model
  {
      protected $table = 'qacategories';
  
      public function question()
      {
          return $this-&gt;hasMany('QandA::class');
      }
  }
  </code></pre>
  
  <p>All I want to do is return them all from a controller and pass them to a view with the category. If I do</p>
  
  <pre><code>class QandAController extends Controller
  {
  
  
      public function Datatable()
          {
              $questions = QandA::all();
              dd($questions);
              return view('datatables.qa',['questions'=&gt;$questions]);
          }
  }
  </code></pre>
  
  <p>(I have referenced the QA class. If I use the code above the dd is fine, but when I try to add ->category in anyway I am told </p>
  
  <pre><code>Property [category] does not exist on this collection instance.
  </code></pre>
  
  <p>Help, please! I know it is something very stupid.</p>