• Stars
    star
    169
  • Rank 224,453 (Top 5 %)
  • Language
    PHP
  • Created almost 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Write to Laravel Config files and maintain file integrity

Laravel Config Writer

Write to Laravel Config files and maintain file integrity.

This library is an extension of the Config component used by Laravel. It adds the ability to write to configuration files.

You can rewrite array values inside a basic configuration file that returns a single array definition (like a Laravel config file) whilst maintaining the file integrity, leaving comments and advanced settings intact.

The following value types are supported for writing: strings, integers, booleans and single-dimension arrays.

Support

This provider is designed to be used in Laravel from 5.4 version.

Setup

Install through composer:

composer require "daftspunk/laravel-config-writer"

Add this to app/config/app.php under the 'providers' key:

October\Rain\Config\ServiceProvider::class,

Lumen case

Add this to bootstrap/app.php in the 'service providers' section declaration:

$app->register(October\Rain\Config\ServiceProvider::class);

Usage

You can write to config files like this:

Config::write('app.url', 'http://domain.com');

app('config')->write('app.url', 'http://domain.com');

Outside Laravel

The Rewrite class can be used anywhere.

$writeConfig = new October\Rain\Config\DataWriter\Rewrite;
$writeConfig->toFile('path/to/config.php', [
    'item' => 'new value',
    'nested.config.item' => 'value',
    'arrayItem' => ['Single', 'Level', 'Array', 'Values'],
    'numberItem' => 3,
    'booleanItem' => true
]);

More Repositories

1

dishsmith

DishSmith is a meal planner created at HACT 2013
CSS
71
star
2

october-twig

This package adds syntax definitions for the October CMS Twig engine. @octobercms http://octobercms.com
HTML
28
star
3

Font-Autumn

The iconic font designed for OctoberCMS
CSS
22
star
4

3d-falling-leaves

A jQuery plugin that drops leaves on the page. http://daftspunk.github.io/3d-falling-leaves/
JavaScript
19
star
5

pond

Desktop application for development and deployment
JavaScript
18
star
6

dry-ui

A set of useful JS tools accumulated over the years
JavaScript
10
star
7

dishsmith-plugin

Plugin used by DishSmith theme
PHP
9
star
8

jquery-vttbuilder

Builder for captions and subtitles in WebVTT format
JavaScript
8
star
9

test-theme

A theme used for testing October CMS functions
HTML
6
star
10

ls-theme-foundation

Foundation Theme for Lemonstand
PHP
5
star
11

ls-module-ahoysupport

PHP
4
star
12

php-mtgox-v1

MtGox V1 API library written in PHP
PHP
4
star
13

october-docker

Example build script for October CMS
Dockerfile
3
star
14

foundationstrap

Foundationstrap aims to bring Foundation style (and some features) to Bootstrap.
JavaScript
3
star
15

utility

a bunch of front-end utilities designed to work with PHPR + Bootstrap
JavaScript
3
star
16

txbutton-plugin

PHP
2
star
17

ls-theme-utility2

A kick-ass starter theme for any Lemonstand store!
PHP
2
star
18

backpack-plugin

A collection of useful front-end components
PHP
2
star
19

ls-module-merchantwarrior

Adds Merchant Warrior payment methods to your Lemonstand store
PHP
1
star
20

zephyr-plugin

Plugin used by Zephyr theme
PHP
1
star
21

multisig-xpub

Testing Multisig (P2SH) XPUB. https://daftspunk.github.io/multisig-xpub
JavaScript
1
star