Setting Config Variables Permanently - laravel-5

I was trying to save my configration variables permanently. For example app.debug i want to change dynamically in my control panel and save it permanently.
I tried lot of packages but not supporting laravel 5.2 or i cant:
https://github.com/Phil-F/Setting/
https://github.com/daftspunk/laravel-config-writer
https://github.com/anlutro/laravel-settings
When I try to overwrite, its going to more big problem because some variables need to get in to environment. How can i do this?
Thank you..

Okay,
I coded a new package for Laravel 5.x and i can make permanently config variable with this code below
Permacon::set("config", "locale", "tr");
Permacon Package => https://github.com/furkankadioglu/Permacon

Related

sentry onpremise how to set domain name?

We have been using old sentry (like 6.*)
We are trying to use the latest onpremise sentry with docker
We don't care about old data, starting fresh is fine.
When I go to the setting page for client-dsn, it has our server's domain name set.
Where did the docker pick this up? and how can I change it?
As far as I have seen th FQDN is taken automatically by Sentry. When doing the first login you are able to set the Root name and there you can change it.
Edit-21.07.2020: As I currently need to do some digging i came across the function:
sentry config set system.url-prefix
or you can set it inside these files:
/etc/sentry/sentry.conf.py
/etc/sentry/config.yml
The below command is deprecated now,
sentry config set system.url-prefix
The better option to edit vim ~/.sentry/config.yml.
Add the below line at the end of vim ~/.sentry/config.yml & restart the sentry.
system.url-prefix: 'https://sentry.example.com'

Laravel configuration usage for different servers in pure php file

I am new in Laravel and want to know such problem
I am running an web application on several server using Laravel.
But I have encountered with an issue.
When there is modification for the project, I need to sync with git on several servers.
But it has different settings for each server (eg: DB name, DB password...)
I have set it manually because I couldn't use .env or configuration file since the file is just pure php file.
The issue I want to solve is how can I get Laravel configuration data from pure PHP file(not controller or whatever).
It will be thankful if someone teach me solution.
You asked:
how can I get Laravel configuration data from pure PHP file
The answer would be this:
You just make some file in config/ folder of laravel app (or use the existing file like config/app.php)
You make an array of your key value pairs
<?php
return [
'some_key' => 'some_value',
...
and you simply call it with this code where ever you need it:
config('config_file.key');
for example
config('app.name');
would give you Laravel by default.

Whats is Production enviroment in Laravel?

I am curious to know what the APP_ENV entry is used for in Laravel environment files. Is it just for my own usage so I can detect it in code? If I create a fresh Laravel app and change APP_ENV to production what will it change under the hood? Nothing?
Thanks!
Typically you would have a different .env file on each server. It is up to you if you would like different parts of your app to work differently in different environments. The .env file is usually used so that your code can just grab values with the env helper function. This way when you change environments like switching from a test API key to a live API key for example, you can just edit the .env file and not touch the rest of your code.
https://laravel.com/docs/5.5/configuration#environment-configuration

Create vs Edit variable permission - Octopus Deploy

I see an edit variable permission that is scoped to the environment. However, it seems like who ever is responsible for setting up the project, would be responsible for creating the variables, where some other security entity would be responsible for only modifying the values, specifically the secure ones. Is this possible?
Edit:
Adding a little more, I suppose I'm asking for permissions based on the project variable set. Only those with the "EditProjectVariableSet" permission would be able to add or remove variables from the project.
Edit:
Added uservoice:
https://octopusdeploy.uservoice.com/forums/170787-general/suggestions/18022360-separate-permission-for-editing-variable-values-wi
In the Configuration->Teams there is a link to Roles.
You could create a new role, for ex: Variable Editor and only assign VariableEdit, VariableEditUnscoped, VariableView, VariableViewUnscoped.
However I don't think you can restrict to a modification only.

Dynamically updating config data codeigniter

I have created my custom config file to store information about site such as if it is online or offline like-vice.
For that I have created new file in config folder and stores default values in global $config[] array with my own index.
I want to update these config data dynamically with admins control eg. he can select to put site in offline mode.
For that I have used function
$this->config->set_item('config_array_index','value_to_set');
but, I don't know why it is not working for me ?
I am not able to see any update in my config file. Also I am autoloading my config file.
Am I missing something?
Setting a config item only applies to the current session - it does not overwrite your actually codeigniter files.
If you want to permanetly take a site offline, your'll need some sort of persistant storage, such as a value in a database that is checked/updated as needed
you can create an empty config file, within your config directory , and then append your data to it using a functionality like fwrite ( you can check for some other CI function to use ).
and add it to your autoload file .

Resources