title: how to create global function that can be accessed from any controller and blade file
body: <p>I have two controller file homecontroller and backendcontroller. What is the best way to create global function and access it from both files? </p>
  
  <p>I found <a href="https://stackoverflow.com/questions/32419619/how-do-i-make-global-helper-functions-in-laravel-5">here</a> Arian Acosta's answer helpful but I wonder if there is an easiest way. I would appreciate any suggestions.</p>