PHPackages                             mindedge/blade - 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. mindedge/blade

Abandoned → [mindedge/ioc](/?search=mindedge%2Fioc)Library

mindedge/blade
==============

A standalone blade package that implementents a mini IoC container, and binds Illiminate\\view to it

3.0.0(6y ago)31251PHPCI failing

Since Jan 23Pushed 6y ago1 watchersCompare

[ Source](https://github.com/mindedge/blade)[ Packagist](https://packagist.org/packages/mindedge/blade)[ RSS](/packages/mindedge-blade/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (9)Versions (8)Used By (0)

[![Latest Version](https://camo.githubusercontent.com/c37c5fa33a4d06737278f64b61dbfeb9290c34abb18abab2c2a9de2fcec71be2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6d696e64656467652f626c6164652e737667)](https://github.com/mindedge/blade/releases)[![Build Status](https://camo.githubusercontent.com/5389984e1c4f46c65b449e209eb3825941ea9bf243b07542d61ef3c2cccd054f/68747470733a2f2f7472617669732d63692e6f72672f6d696e64656467652f626c6164652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mindedge/blade)[![Coverage Status](https://camo.githubusercontent.com/687a650e50b39edeb176de5e12b84f8bec614367d42aeb9346e9cab6499d6647/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d696e64656467652f626c6164652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/mindedge/blade?branch=master)

Mindedge Blade
==============

[](#mindedge-blade)

Composer package that provides Laravels IOC Container, which any laravel service can be bound to. This package currently provides the following services out of the box:

1. Illuminate\\view - [Github Link](https://github.com/illuminate/view), [Illuminate Api Documentation](https://laravel.com/api/5.7/Illuminate/View.html)

    This is the service thats provides the blade engine.
2. Illuminate\\config - [Github Link](https://github.com/illuminate/config), [Illuminate Api Documentation](https://laravel.com/api/5.7/Illuminate/Config.html)

    This is the service that allows services to have dedicated, easy to understand configuration files.
3. Illuminate\\database - [Github Link](https://github.com/illuminate/database), [Illuminate Api Documentation](https://laravel.com/api/5.7/Illuminate/Database.html)

This is the service that provides database services such as Eloquent.

The package is now hosted on packagist, which means adding the repository array is not longer nessisary.

Installation
------------

[](#installation)

You can use the below require statement from the command line in the root directory (assuming a composer.json already exists):

```
composer require mindedge/blade

```

Alternativly, simply add to existing dependency to "require" object in composer.json,

```
"require": {
    "mindedge/blade": "^2.0.0"
}

```

And then run

```
composer install

```

Configuration:
==============

[](#configuration)

Within the root directory of of your app, create four directories. I have used the "ROOTDIR" to denote the application root.

1. ROOTDIR/bootrap
2. ROOTDIR/config
3. ROOTDIR/cache
4. ROOTDIR/views

Note: the 'views' directory will correspond to wherever your application holds its presentation layer files and is configurable. You may name/change the views directory to whatever makes sense for your application.

You should wind up with something like this:

```
|...
|
|-config
|-boostrap
|-cache
|-views
|
|...

```

In the newly crated boostrap directory, create a single file named app.php, with the below conents.

```
require_once __DIR__.'/../vendor/autoload.php';

use  Mindedge\Blade\Application;

$app = new Application(
    dirname(__DIR__)
);

$app->withFacades();

//$app->withEloquent();

//Nothing Below These Two Lines!
$app->boot();

return $app;

```

> Note:
> If you do not plan on using the view, database, or config facades, you may comment '$app-&gt;withFacades out'.
> To use eloquent, Simply uncomment '$app-&gt;withEloquent'. If using you plan on using Models, make sure to add a psr4 entry in your composer.json to thier location.

This example shows the autoload script being included, but as long as vendor/autoload.php is included somewhere in the project thats globally accessable, thats a fine approach as well.

In the newly created config directory, create a single file named view.php, and place the following starter config:

```
