1

How to use Customized Function Laravel Framework

Function :

function convertNumberToWord()
{

}
2
  • 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 for more information. Commented Feb 20, 2016 at 11:21
  • Your question seems to be answered here: stackoverflow.com/questions/28290332/… Commented Feb 23, 2016 at 15:40

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

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.
You are assuming the OP is well acquainted with composer and laravel, hence the context.
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.