bosnadev / yaml
A package to add Yaml file support for Laravel 4 Configuration
Installs: 3 089
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 1
Open Issues: 2
Requires
- php: >=5.4.0
- illuminate/support: 4.2.*
This package is auto-updated.
Last update: 2024-11-11 21:01:56 UTC
README
This package is based on a devitek/yaml-configuration package. It uses Symfony/Yaml parser. Yaml configuration package is part of Larapress CMS.
Installation
Run the following command from your terminal:
composer require "bosnadev/yaml: 1.*"
or add this to require section in your composer.json file:
"bosnadev/yaml": "1.*"
and run composer update
After updating composer, add the YamlServiceProvider to the providers array in app/config/app.php
'providers' => [
// other providers
...
'Bosnadev\Yaml\YamlServiceProvider'
];
And that's it! You can now add your .yaml configuration files into app/config or in your package config folders. You can continue to use regular php files for configs.
PHP:
<?php
return [
'enable_registration' => true,
'themes_dir' => %public_path%/themes
];
Will be equivalent to :
---
enable_registration: true
themes_dir: %public_path%/themes
Paths Helpers
You can use paths helpers provided by Laravel like that :
routes_file: %app_path%/routes.php unit_test: %base_path%/behat.yml main_style: %public_path%/css/style.css manifest: %storage_path%/meta
- %app_path% refers to app_path()
- %base_path% refers to base_path()
- %public_path% refers to public_path()
- %storage_path% refers to storage_path()
License
This package is open-sourced software licensed under MIT License.