How to use my constants in Larvel

Create a file constants.php inside app/config/ and put your settings in an array:

<?php
//file : app/config/constants.php

return [
	'ADMIN_NAME' => 'administrator'
];

Then anywhere in your controllers or views you can get the value by using Config Facade:

echo Config::get('constants.ADMIN_NAME');

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
declare constant in laraval laravel constants example laravel 6 define a constante? constant in laravel use constants,php in laravel use constants in laravel how to use value from constants.php in laravel how to access constants in from constant.php in laravel laravel how to add constant how to create constant values in laravel make constant in laravel best way to deal with constants in laravel how to use constant in laravel blade how to create constant in laravel best way to handle constants in laravel\ laravel declare constants where to put constant in laravel laravel constant classes php laravel constant classes laravel declare constant how to create constant in laravel model create constant laravel access define constant laravel laravel constant variable set constant variable in laravel laravel constant define constants laravel right way to create constant on laravel laravel declaring a constant laravel constant define constant laravel how to define constant in laravel make some constants in laravel how to set constant in laravel how to add constant in laravel laravel define constant where to set constant variable in laravel laravel where set constant how to define a constant in laravel define constant variable in laravel define constant in laravel 8 how to add constant value in laravel what is constant in laravel constant php laravel how to use constant in laravel php define constants laravel constant laravel Laravel using constants constants in laravel declaring constant in laravel define constant in laravel define constants in laravel laravel use constants create constant in laravel laravel access constant in controller define global constant in laravel 8 package access config constants attribute laravel define const in laravel how to get constant value in laravel create constants in laravel const in laravel laravel where to define constants laravel where to put constants config constants laravel constants.php laravel declaring constants laravel constant define in laravel laravel set model const value from config get value from config constants file laravel laravel global constats hoe to chnages constants values from fie in laravel laravel set class global constant get constant value in laravel laravel constants file constants.php laravel 7 how to add a constants file in laravel define const varibale in laravel where to define constant in laravel laravel call config variable as constant storing dynamic constants laravel laravel define constants laravel custom constants store constants in laravel laravel constants add global constant laravel use a constant inside view laravel defined in helper file use a constant inside view laravel why does my chrome console show undefined after declaring variables whey i cant see my main.c in codeblocks why can't def on_mouse_down go into my update def pygame what to do after you install express to create an api make your own json database &quot;get&quot; &quot;post&quot; what to put in owershell profile save constants in laravel How to use my constants in Larvel
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source