Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToDo : Get config file value if doesn't exist in Setting #4

Open
AEK-BKF opened this issue May 3, 2017 · 1 comment
Open

ToDo : Get config file value if doesn't exist in Setting #4

AEK-BKF opened this issue May 3, 2017 · 1 comment

Comments

@AEK-BKF
Copy link

AEK-BKF commented May 3, 2017

Hi,

Thank so much for this nice package,
I've a suggestion :
It's a good idea to add a function that retrieves a value from a file config when it doesn't exist in Setting table,
Example:
$value = Setting::get('file.name'); // It returns config('file.name').

Thanks :)

@youchenlee
Copy link
Member

youchenlee commented May 18, 2017

Excellent idea.

The long one would be use the default value parameter, it's very redundant:

$value = Setting::get('file.name', config('file.name'));

perhaps adding a setFallback() method, and can be use like:

Settings::setFallback(function ($key, $default) {
    return config($key, $default);
});

what do you think? @AEK-BKF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants