title: nested resources in laravel
body: <p>I´m building my API (makes and models) and I want to have nested resources (not sure if this is correct Restfully speaking)</p>
  
  <p>/makes/ferrari/models
  /makes/ferrari/models/f40</p>
  
  <p>I defined the following route</p>
  
  <pre><code>Route::resource('makes.models', 'ModelsController');
  </code></pre>
  
  <p>and the ModelsController.php</p>
  
  <pre><code>/**
   * Display a listing of the resource.
   *
   * @return \Illuminate\Http\Response
   */
  public function index()
  {
      $data = Models::all();
      return response()-&gt;json($data);
  }
  
  /**
   * Display the specified resource.
   *
   * @param  int  $id
   * @return \Illuminate\Http\Response
   */
  public function show($id)
  {
      $data = Models::find($id);
      return response()-&gt;json($data);
  }
  </code></pre>
  
  <p>and the models  model (yeah I need to change the name)</p>
  
  <pre><code>class Models extends Model
  {
  
      public function make()
      {
          return $this-&gt;belongsTo('App\Make');
      }
  }
  </code></pre>
  
  <p>my problem is that even if the route works it returns all models in the db (not only ferraris) where should I define that relationship? is not automatic? 
  I have 2 tables makes (id, name), models (id, name, make_id)</p>
  
  <p>thank you!</p>