title: API Design - Endpoint to retrieve ressources Column names
body: <p>I would like to know what would be the best practice to get the column names of a resource.</p>
  
  <p>I'm using Vue JS for the front end, and Laravel for the API and want to create a search system with a dropdown input listing all the fields of my resource, so I can make a search filtered by fields:</p>
  
  <p><a href="https://i.stack.imgur.com/GMskx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GMskx.png" alt="enter image description here"></a></p>
  
  <p>So my search bar is a Vue Component, and when the component is ready, I'm trying to populate the dropdown with the list of Columns.</p>
  
  <p>In term of API design, what would be the better solution to implement that ? </p>
  
  <p>I was thinking about 2 different endpoints, but I don't have enough experience in building API to know which one is better :  </p>
  
  <ol>
  <li><p><code>api/resource_name/columns</code></p></li>
  <li><p><code>api/metadata/resource_name/columns</code></p></li>
  </ol>
  
  <p>So in <code>solution 1</code>, an action in the resource controller will return the list of columns, and in the <code>solution 2</code>, a separate controller (<code>metadata</code>), will be in charge of that, and could be used for others tasks like this one.</p>
  
  <p>What do you think? </p>