2017 © Pedro Peláez
 

library variables

Laravel package to allow site owners to override a specific config files' variables

image

devfactory/variables

Laravel package to allow site owners to override a specific config files' variables

  • Friday, May 6, 2016
  • by devfactory
  • Repository
  • 4 Watchers
  • 1 Stars
  • 3,788 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 14 Versions
  • 0 % Grown

The README.md

Laravel Laravel License, (*1)

Variables

This is a package for the Laravel framework, it allows for a specified set of variables to be overridden in the database by the user of the site, (*2)

Installation

Laravel 5

Using Composer, edit your composer.json file to require devfactory/media., (*3)

"require": {
  "devfactory/variables": "2.0.*"
}

Then from the terminal run, (*4)

composer update

Then in your app/config/app.php file register the service provider:, (*5)

'Devfactory\Variables\VariablesServiceProvider',

and the Facade:, (*6)

'Variables' => 'Devfactory\Variables\Facades\VariablesFacade',

From within the the laravel folder of your project, run:, (*7)

php artisan vendor:publish

Run the migration to create the DB table:, (*8)

php artisan migrate

You have to add the Controller to your routes.php, so that you can set your own url/filters., (*9)

Route::group(array('before' => 'admin-auth'), function() {
  Route::controller('variables', '\Devfactory\Variables\Controllers\VariablesController');
});

Laravel 4

Using Composer, edit your composer.json file to require devfactory/media., (*10)

"require": {
  "devfactory/variables": "1.0.*"
}

Then from the terminal run, (*11)

composer update

Then in your app/config/app.php file register the service provider:, (*12)

    'Devfactory\Variables\VariablesServiceProvider',

and the Facade:, (*13)

    'Variables' => 'Devfactory\Variables\Facades\VariablesFacade',

Run the migration to create the DB table:, (*14)

php artisan migrate --package=devfactory/variables

Finally, publish the config to make changes to where and how the files are stored:, (*15)

php artisan config:publish devfactory/variables

You have to add the Controller to your routes.php, so that you can set your own url/filters., (*16)

    Route::group(array('before' => 'admin-auth'), function() {
        Route::controller('variables', 'Devfactory\Variables\Controllers\VariablesController');
    });

Usage

Visiting the url you set in your routes file as shown above, allows you to see all the current variables, as well as override them by entering a new value and saving., (*17)

You can then use the variables through calls to the Variables facade:, (*18)

<?php

$api_key = Variables::get('api_key'); // da46f8af58aec448c784dd421660f7635d404feb

Other public methods in the Facade are:, (*19)

<?php

// Retrieve an array of all the variables
Variables::getAll();

// Set the value of a variable
Variables::set('api_key', 'da46f8af58aec448c784dd421660f7635d404feb');

// Unset the value of a variable stored in the DB
Variables::remove('api_key');

The Versions

06/05 2016

2.0.x-dev

2.0.9999999.9999999-dev

Laravel package to allow site owners to override a specific config files' variables

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar devfactory

06/05 2016

dev-master

9999999-dev

Laravel package to allow site owners to override a specific config files' variables

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar devfactory

06/05 2016

2.0.6

2.0.6.0

Laravel package to allow site owners to override a specific config files' variables

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar devfactory

15/09 2015

2.0.5

2.0.5.0

Laravel package to allow site owners to override a specific config files' variables

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar devfactory

11/09 2015

2.0.4

2.0.4.0

Laravel package to allow site owners to override a specific config files' variables

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar devfactory

27/08 2015

2.0.3

2.0.3.0

Laravel package to allow site owners to override a specific config files' variables

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar devfactory

14/08 2015

2.0.2

2.0.2.0

Laravel package to allow site owners to override a specific config files' variables

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar devfactory

24/04 2015

2.0.1

2.0.1.0

Laravel package to allow site owners to override a specific config files' variables

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar devfactory

13/04 2015

2.0.0

2.0.0.0

Laravel package to allow site owners to override a specific config files' variables

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar devfactory

17/12 2014

1.0.x-dev

1.0.9999999.9999999-dev

Laravel package to allow site owners to override a specific config files' variables

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar devfactory

17/12 2014

1.0.3

1.0.3.0

Laravel package to allow site owners to override a specific config files' variables

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar devfactory

25/11 2014

1.0.2

1.0.2.0

Laravel package to allow site owners to override a specific config files' variables

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar devfactory

25/11 2014

1.0.1

1.0.1.0

Laravel package to allow site owners to override a specific config files' variables

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar devfactory

24/11 2014

1.0.0

1.0.0.0

Laravel package to allow site owners to override a specific config files' variables

  Sources   Download

MIT

The Requires

 

by Avatar devfactory