1

How to use Customized Function Laravel Framework

Function :

function convertNumberToWord()
{

}
Karthik
  • 5,589
  • 18
  • 46
  • 78
  • 3
    Welcome to StackOverflow, Karthik! Unfortunately your question is unsuitable for this site. We'll be happy to help you with the specific problems you encounter while programming your stuff, but you have to **add more details** and **show more relevant code.** **You can edit questions using ‘edit’ link below tags list.** Please see **“[How do ask a good question](http://stackoverflow.com/help/how-to-ask)”** for more information. – fusion3k Feb 20 '16 at 11:21
  • Your question seems to be answered here: http://stackoverflow.com/questions/28290332/best-practices-for-custom-helpers-on-laravel-5 – Jocelyn Feb 23 '16 at 15:40

1 Answers1

1

What you could do for starters, is to create a helpers.php file anywhere inside app dir, and require it in the file routes.php located at app/Http.

This will make your custom functions available everywhere in laravel.

Later on you should consider using a ServiceProvider for doing this, as that is the proper laravel way to it.

user2094178
  • 9,204
  • 10
  • 41
  • 70
  • 1
    why would you require it in routes.php? A far more robust solution would be to add it to the files autoloader in composer. I can't see why you would use a service provider either to require helper libraries. – David Barker Feb 20 '16 at 13:51
  • 1
    You are assuming the OP is well acquainted with `composer` and laravel, hence the context. – user2094178 Feb 20 '16 at 13:56
  • 1
    I understand your reasoning, however teaching inadequate practices on the premise that someone won't understand you is not a particularly good way to teach. Explanation and detail in answers will go much further to assisting and will probably earn you far more +1's. – David Barker Feb 20 '16 at 14:02