PHPackages                             acidjazz/larjectus - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. acidjazz/larjectus

ActiveLibrary[Framework](/categories/framework)

acidjazz/larjectus
==================

Adds the power of objectus to Laravel and Lumen

v0.9(9y ago)0357[1 PRs](https://github.com/acidjazz/larjectus/pulls)MITPHPPHP &gt;=5.6.25

Since Jul 24Pushed 6y ago1 watchersCompare

[ Source](https://github.com/acidjazz/larjectus)[ Packagist](https://packagist.org/packages/acidjazz/larjectus)[ RSS](/packages/acidjazz-larjectus/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (11)Used By (0)

[![](media/objectus128.png)](http://github.com/acidjazz/objectus)[![](media/and128.png)](media/and128.png)[![](media/laravel128.png)](http://laravel.com)[![](media/plus128.png)](media/plus128.png)[![](media/lumen128.png)](http://lumen.laravel.com)

Allows you to use [Objectus](http://github.com/acidjazz/objectus) seamlessly in [Laravel 5](http://laravel.com) and [Lumen](http://lumen.laravel.com)

[![Total Downloads](https://camo.githubusercontent.com/96e3f898bcb89fac92b7529c21ce2e8fc933fe99dea2ff4b9912605781c016b4/68747470733a2f2f706f7365722e707567782e6f72672f616369646a617a7a2f6c61726a65637475732f646f776e6c6f616473)](https://packagist.org/packages/acidjazz/larjectus)[![Latest Stable Version](https://camo.githubusercontent.com/220017d055d90d99e91b4beafd0aadee118f5d287953369d393595aea5f2277d/68747470733a2f2f706f7365722e707567782e6f72672f616369646a617a7a2f6c61726a65637475732f762f737461626c65)](https://packagist.org/packages/acidjazz/larjectus)[![License](https://camo.githubusercontent.com/2ef021d498b2548df223427c3fc0427a7fbd21475e35bb15a5affc01b53625c8/68747470733a2f2f706f7365722e707567782e6f72672f616369646a617a7a2f6c61726a65637475732f6c6963656e7365)](https://packagist.org/packages/acidjazz/larjectus)[![Build Status](https://camo.githubusercontent.com/61da8e62e2441701c90d3f27b69a7a9e1b51627a70ddd45f19a81e9099a219ba/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f616369646a617a7a2f6c61726a65637475732e737667)](https://travis-ci.org/acidjazz/larjectus)[![Dependency Status](https://camo.githubusercontent.com/173b636ff416c8984d1590d0c6e8d1cc5b2fe33a589ad3175181bcee67169674/68747470733a2f2f7777772e67656d6e617369756d2e636f6d2f6261646765732f6769746875622e636f6d2f616369646a617a7a2f6c61726a65637475732e737667)](https://www.gemnasium.com/github.com/acidjazz/larjectus)[![Coverage Status](https://camo.githubusercontent.com/21c1eacb2f0735892bb4f391abf8e77a7278285f6148b184a46f0a8a89d5cdf1/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f616369646a617a7a2f6c61726a65637475732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/acidjazz/larjectus?branch=master)[![codecov](https://camo.githubusercontent.com/371f221593d78e292c19304b04a6d912f9801fd9c55fa6b74d105bdd0372cd5f/68747470733a2f2f636f6465636f762e696f2f67682f616369646a617a7a2f6c61726a65637475732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/acidjazz/larjectus)[![Codacy Badge](https://camo.githubusercontent.com/0a603159e28119c1557f110ee8fb0391d9cb24e036c3d45a657068c4d34f4627/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6530303738623533323330373437653838323934663330353466323635316430)](https://www.codacy.com/app/acidjazz/larjectus?utm_source=github.com&utm_medium=referral&utm_content=acidjazz/larjectus&utm_campaign=Badge_Grade)

What this does
==============

[](#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
=====================

[](#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

Requirements
============

[](#requirements)

- [PHP v7.0.0+](https://www.php.net/)
- [PHP-YAML](http://php.net/manual/en/book.yaml.php)

Installation
============

[](#installation)

Require this package with Composer

```
composer require acidjazz/larjectus
```

Laravel
-------

[](#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:

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

Lumen
-----

[](#lumen)

For usage with [Lumen](http://lumen.laravel.com), add the service provider in `bootstrap/app.php`.

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

configuration
=============

[](#configuration)

gulpfile.js example(s)
----------------------

[](#gulpfilejs-examples)

Your gulp task is different from how [Objectus](https://github.com/acidjazz/objectus) works, here is an example of compiling a JSON version of your config for JavaScript access:

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

```
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
