How to make a constant and use globally?
Answer / Kamlesh Kaushal
To define a constant in PHP, you can use the `define()` function or declare it at the top of your script. To make it available globally, you should define it before any class declarations. For example:nn```phpndefine('MY_CONSTANT', 'some value');nclass MyClass {n //...n}n```
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the use of blade?
How to create a controller in laravel?
What is the directory structure of laravel 5.6?
Write down the name of some aggregates methods provided by the laravel's query builder.
What are pros and cons of using laravel framework?
What is controller middleware in laravel?
What is composer in laravel php?
What is url helper?
Define hashing in laravel.
Which template engine is used by laravel?
What is route parameters in laravel?
How do you do dependency injection in laravel?