Example #1
0
 static function display_env_set($env_key, $field)
 {
     if (getenv($env_key)) {
         $field['props']['disabled'] = true;
         $field['props']['class'] .= ' disabled';
         $field['props']['placeholder'] = 'Set with environment variable';
         $field['type'] = 'text';
     }
     $field['display_callback'] = function ($value, $props) use($env_key) {
         echo Field::input($value, $props);
         echo '<br/><small>Environment Key: <strong>' . $env_key . '</strong></small>';
     };
     return $field;
 }