PHPackages                             danielrhodeswarp/kimino-config - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. danielrhodeswarp/kimino-config

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

danielrhodeswarp/kimino-config
==============================

Easy configuration setting and getting for Laravel projects

0.0.6(10y ago)045MITPHPPHP &gt;=5.3.0

Since Jan 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/danielrhodeswarp/kimino-config)[ Packagist](https://packagist.org/packages/danielrhodeswarp/kimino-config)[ Docs](https://github.com/danielrhodeswarp/kimino-config)[ RSS](/packages/danielrhodeswarp-kimino-config/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

kimino-config
=============

[](#kimino-config)

Sounds weird. What is it?
-------------------------

[](#sounds-weird-what-is-it)

It's a Laravel 5 package to quickly enable database setting and getting of administrator or application level settings; settings that *might* be tinkered with during the lifetime of an application.

What is it good for?
--------------------

[](#what-is-it-good-for)

It's good for implementation preparedness around project specification that you sense - or know - will change in future. Also good for trialling different algorithms. Also good for experimenting with implementation or design specification that can't quite be decided by everyone. Also good for rulepacks.

So what's new in v0.0.5?
------------------------

[](#so-whats-new-in-v005)

- Documentation
- Improved vanilla view
- Added Foundation view
- Commented and cleaned up the code
- Views, config and publics are publishable with vendor:publish (together or individually)

What does it come with?
-----------------------

[](#what-does-it-come-with)

- Migration for the settings table (you need to run this!)
- Optional Artisan command to seed some example settings
- Controller, routing and view to see and update settings on an HTML form
- Above form view is publishable into your project
- Publishable config file
- vanilla or Foundation HTML view (Foundation assets need to be published)
- Artisan command to view all / certain settings
- Artisan command to update a setting

How do I install this thing?
----------------------------

[](#how-do-i-install-this-thing)

1. `composer require danielrhodeswarp/kimino-config` in your Laravel 5 project's home folder. (Or you can add `danielrhodeswarp/kimino-config` to your project's composer.json file - and then run `composer install` - if you know what you are doing.)
2. In the `'providers'` bit of your project's config/app.php file add `Danielrhodeswarp\KiminoConfig\KiminoConfigServiceProvider::class`.
3. `php artisan migrate --path=vendor/danielrhodeswarp/kimino-config/src/database/migrations` to run the migration to create the kimino\_configs table.
4. (If you want to override package config it's `php artisan vendor:publish --tag=config`. If you want to edit the views it's `php artisan vendor:publish --tag=views`. If you want to override the config to use the Foundation view it's `php artisan vendor:publish --tag=public`. Or of course publish everything with `php artisan vendor:publish`. Note that Kimino Config will work, using defaults, without publishing anything.)

How do I give it a quick check?
-------------------------------

[](#how-do-i-give-it-a-quick-check)

After installation, your-project.url/kimino-config will now show the only view that Kimino Config has - a page to view **all** the settings in the database and to update any of their values if necessary.

You won't have any settings yet. As a test you can add some dummy settings with `php artisan kimino:seed-examples`.

`php artisan kimino:get-config` will dump out all of the settings, something like:

SettingValueValid valuesother\_legarbitrary-valueother\_newsnoyes,nosomething\_auth\_methoddigestbasic,digestsomething\_trial\_months6`php artisan kimino:get-config other_news` will dump out the specified setting, like:

SettingValueValid valuesother\_newsnoyes,no`php artisan kimino:set-config other_leg` will prompt for - and set if valid - a new value for the specified setting.

What do these settings look like in the database?
-------------------------------------------------

[](#what-do-these-settings-look-like-in-the-database)

Settings have four fields in the database (and also an auto-incrementing id field):

FieldCan be null?DescriptionsettingnoName of setting. Words separated by underscores and must contain at least one underscore. Like `something_or_other`. Settings are grouped on the HTML form by *prefix* which is the word before the first underscore.valuenoValue of setting. Will be empty string, any string or - if valid\_values is not empty - one of the strings in valid\_valuesvalid\_valuesyesIf empty, then the setting is free text. If set to a comma-separated (no spaces) list of words, then the setting value can only be one of those words (and this will be enforced when updating values with the HTML form or the Artisan command).user\_hintyesA human friendly explanation of the setting for whosoever might be tinkering with it on the HTML formHow do I add my own settings?
-----------------------------

[](#how-do-i-add-my-own-settings)

To add a basic free text setting you simply need to add a new database entry containing the setting name with relevant prefix in *setting* and the current or default value for the setting in *setting*. I would always recommend adding a nice, descriptive hint in *user\_hint* at setting creation time too!

To add a setting with a restricted set of values, for example "queue emails: yes or no" or "heading font: courier, verdana or times", follow the same steps as above but also put the value restrictions in *valid\_values* like `yes,no` or `courier,verdana,times` (respectively).

Note that, by design, there is no programmatic way to add a new setting. You can of course use a Laravel seed (created with, say, `php artisan make:seeder SeedMyKiminos`) something like:

```
