title: Laravel 5 call a model function in a blade view
body: <p>I want to build a blade view from 3 tables:</p>
  
  <ul>
  <li>"inputs_details" - fields: article_type (values: 'p' for product,'s' for service), article_id, ....</li>
  <li>"products" - fields: id, name</li>
  <li>"services" - fields: id, name</li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/otgHK.jpg" alt="enter image description here"></p>
  
  <p>But, in browser, I have the error: "Class 'Product' not found".</p>
  
  <p>Is there a solution to pass to the view this function (to find the name of the product or the service based on article_type and article_id)?</p>
  
  <p>I was trying also with join query, but I couldn't put so many conditions in a single join query .. where article_type is "p", then join with "products" table ... or .... where article_type is "s", then join with "services" table.</p>