2017 © Pedro Peláez
 

library larjectus

Adds the power of objectus to Laravel and Lumen

image

acidjazz/larjectus

Adds the power of objectus to Laravel and Lumen

  • Thursday, March 2, 2017
  • by acidjazz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 334 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

, (*1)

Allows you to use Objectus seamlessly in Laravel 5 and Lumen, (*2)

Total Downloads Latest Stable Version License Build Status Dependency Status Coverage Status codecov Codacy Badge, (*3)

What this does

  • Combines your .env and config/ options with as many YAML and JSON files and directories you want to add inside config/
  • Allows for functionality to share this data in any language(s) your resources/ or public/ folders might use

Why would I want this

Most all of my projects have extended configuration, everything from style guides to site copy, this allows stylus/css and coffeescript/javascript access to this data, (*4)

Requirements

Installation

Require this package with Composer, (*5)

composer require acidjazz/larjectus

Laravel

Once Composer has installed or updated your packages you need to register Larjectus with Laravel itself. Open up config/app.php and find the providers key, towards the end of the file, and add 'Larjectus\ServiceProvider', to the end:, (*6)

'providers' => [
  ...
    Larjectus\ServiceProvider::class,
],

Lumen

For usage with Lumen, add the service provider in bootstrap/app.php., (*7)

$app->register(Larjectus\ServiceProvider::class);

configuration

gulpfile.js example(s)

Your gulp task is different from how Objectus works, here is an example of compiling a JSON version of your config for JavaScript access:, (*8)

🚨 Note the secure array where i remove any secure data, like DB passwords and AWS credentials. 🚨, (*9)


exec = require('child_process').exec; objectify = function() { var config, secure; config = {}; secure = ['auth', 'database']; return exec('php artisan larjectus:config', function(error, result, stderr) { var dim, i, len, pubconfig; if (error) { notify(error); } this.config = JSON.parse(result); pubconfig = this.config; for (i = 0, len = secure.length; i < len; i++) { dim = secure[i]; delete pubconfig[dim]; } return fs.writeFileSync('public/js/config.js', "config="+JSON.stringify(pubconfig)+";", 'utf8'); }); }; objectify(); gulp.task('larjectus', objectify); gulp.task('watch', function() { gulp.watch('config/**/*', ['larjectus']); );

Here is an example of giving config access to stylus you would need the sample gulp task above :, (*10)


stylus = require('gulp-stylus'); gulp.task('stylus', function() { return gulp.src('resources/stylus/main.styl') .pipe(stylus({ rawDefine: { config: config } }).on('error', notify.onError(function(error) { return { title: 'Stylus error: ' + error.name, message: error.message, sound: 'Pop' }; }))) .pipe(gulp.dest('public/css/')) .pipe(sync.stream()); }

The Versions

02/03 2017

dev-master

9999999-dev

Adds the power of objectus to Laravel and Lumen

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kevin Olson

laravel lumen objectus

05/09 2016

v0.1.0

0.1.0.0

Adds the power of objectus to Laravel and Lumen

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kevin Olson

laravel lumen objectus

05/09 2016

v0.9

0.9.0.0

Adds the power of objectus to Laravel and Lumen

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kevin Olson

laravel lumen objectus

04/09 2016

v0.8

0.8.0.0

Adds the power of objectus to Laravel and Lumen

  Sources   Download

MIT

The Requires

  • php >=5.6.25

 

The Development Requires

by Kevin Olson

laravel lumen objectus

04/09 2016

v0.7

0.7.0.0

Adds the power of objectus to Laravel and Lumen

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Kevin Olson

laravel lumen objectus

30/08 2016

v0.6

0.6.0.0

Adds the power of objectus to Laravel and Lumen

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Kevin Olson

laravel lumen objectus

30/08 2016

v0.5

0.5.0.0

Adds the power of objectus to Laravel and Lumen

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Kevin Olson

laravel lumen objectus

28/07 2016

v0.4

0.4.0.0

Adds the power of objectus to Laravel and Lumen

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Kevin Olson

laravel lumen objectus

24/07 2016

v0.3

0.3.0.0

Adds the power of objectus to Laravel and Lumen

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Kevin Olson

laravel lumen objectus

24/07 2016

v0.2

0.2.0.0

Adds the power of objectus to Laravel and Lumen

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Kevin Olson

laravel lumen objectus

24/07 2016

v0.1

0.1.0.0

Adds the power of objectus to Laravel and Lumen

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Kevin Olson

laravel lumen objectus