title: How to select foreign key value in Laravel
body: <p>I've two tables one is <strong>car_category</strong> having the fields - <strong>id,type</strong>.
  Another table named  <strong>vehicle</strong> having field - <strong>c_id</strong>(FK Refers <strong>car</strong> - id).
  Now I want to display the FK(c_id) value which is <strong>car</strong>-type.
  I've below code in models,</p>
  
  <pre><code>class Car extends Model
  {
      protected $guarded = [];
      protected $table = 'car_category';
  
      public function vehicles()
      {
          return $this-&gt;hasMany('Vehicle');
      }
  }
  </code></pre>
  
  <p>vehicle model,</p>
  
  <pre><code>class Vehicle extends Model
  {
      protected $guarded = [];
      protected $table = 'vehicles';
      public function cars()
      {
          return $this-&gt;belongsTo('Car');
      }
  }
  </code></pre>
  
  <p>What 'll be my query for this? I've tried this code, results error.</p>
  
  <pre><code>$vehicles = "SELECT cars.cartype,vehicles.model FROM cars,vehicles 
               WHERE cars.id = vehicles.c_id";
  </code></pre>
  
  <p>How can I achieve this? Can anybody help me?</p>