title: Helper function in Laravel 5
body: <p>I have a function which gives me a <em>guid</em>. However, I cannot figure how to actually implement it in Laravel 5, so I can use it in my controllers.</p>
  
  <p>This is the function:</p>
  
  <pre><code>function getGuid() {
      return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
          mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
          mt_rand( 0, 0xffff ),
          mt_rand( 0, 0x0fff ) | 0x4000,
          mt_rand( 0, 0x3fff ) | 0x8000,
          mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )
      );  
  }
  </code></pre>
  
  <p>How do I implement this, so I can access it from my controllers?</p>