title: Method for get id through value - Laravel
body: <p>Through this query I find a element in a database by value and take the id:</p>
  
  <pre><code>Model::where($table,'=',$value)-&gt;first()-&gt;id;
  </code></pre>
  
  <p>But I need to create a method, because I use this code with other models; a possible example:</p>
  
  <pre><code>public function getId($model,$table,$value) {
      ...
  }
  </code></pre>
  
  <p>How can I do? </p>
  
  <p>Thanks!</p>