krom / laravel-yaml-configuration by kudlayry
forked from Devitek/laravel-yaml-configuration

Add YAML file support to Laravel Configuration
3
0
1
Package Data
Maintainer Username: kudlayry
Maintainer Contact: roman@kudlay.pro (Roman Kudlay)
Package Create Date: 2015-12-24
Package Last Update: 2015-12-29
Home Page:
Language: PHP
License: Unknown
Last Refreshed: 2024-04-25 15:10:14
Package Statistics
Total Downloads: 3
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

Add Yaml file support for Laravel 5.1 Configuration

This package uses Symfony/Yaml parser.

Installing

Add "krom/laravel-yaml-configuration": "2.*" to your composer.json by running :

php composer.phar require krom/laravel-yaml-configuration

And select version : 2.*

Add support in Laravel

You have to add (or merge)

protected function bootstrappers()
{
    return array_merge($this->bootstrappers, [\\krom\\Core\\Config\\LoadYamlConfiguration::class]);
}

to your app/Http/Kernel.php and/or app/Console/Kernel.php.

How to use

Just use regular php files or use yml or yaml files instead.

PHP :

<?php

return [
	'debug' => false,
    'key' => 'foobar',
];

Will be equivalent to :

YAML

debug: false
key: foobar

Use functions

You can use any php functions like that :

routes_file: %app_path%/routes.php
unit_test: %base_path:behat.yml%
something: %sprintf:hell %s,world%

Enjoy it ! Feel free to fork :) !

This package is fork of devitek/yaml-configuration