What is the best practice for adding constants in laravel? (Long List)

后端 未结 11 743
猫巷女王i
猫巷女王i 2021-01-30 06:21

I am rather new to laravel. I have a basic question, What is the best way to add constants in laravel. I know the .env method that we use to add the constants. Also I have mad

11条回答
  •  被撕碎了的回忆
    2021-01-30 07:13

    You can create a file named paths.php in root directory/config/paths.php

    Insert this data into paths.php

    define('OPTION_ATTACHMENT', 13);
    define('OPTION_EMAIL', 14);
    define('OPTION_MONETERY', 15);
    define('OPTION_RATINGS', 16);
    define('OPTION_TEXTAREA', 17);
    

    Note : make sure to run command : php artisan config:clear

提交回复
热议问题