在所有视图和控制器中可用的Config文件夹中声明Laravel中的全局可访问变量

I read the question

global variable for all controller and views

It tells about declaring a variable in the filters.php in the root folder, (Thought it was said it is not a good practice to declare in the filters.php file )I tried but didn't succeed. But i need to declare a variable in any file of the config folder that should be available to all controllers and views.

Where should i do this ?

You can create a PHP file inside app/config folder

For example: Create app/config/settings.php

Inside this settings.php:

<?php
     return array(
                 'LANGUAGE_ID' => 1,
                 'DATE_FORMAT' => 'Y-m-d'
            );

And you can access this in views and controllers using:

Config::get('settings.LANGUAGE_ID');

If you will create different environment, you need to put the newly created config file to each environment folder.