PHPackages                             shincode/envision - 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. shincode/envision

ActiveLibrary[Framework](/categories/framework)

shincode/envision
=================

Envision for Laravel 4

2992PHP

Since Mar 26Pushed 4y ago1 watchersCompare

[ Source](https://github.com/shincode/envision)[ Packagist](https://packagist.org/packages/shincode/envision)[ RSS](/packages/shincode-envision/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Envision
--------

[](#envision)

Envision is a framework extension for Laravel 4.2. [![ProjectStatus](https://camo.githubusercontent.com/d09be3fbf221c201e81559131e746c826f8fd9a137b4e9d01d84218765ae01c5/687474703a2f2f7374696c6c6d61696e7461696e65642e636f6d2f5368696e436f64652f656e766973696f6e2e706e67)](http://stillmaintained.com/ShinCode/envision)

The goal of using Envision is speeding up development. It does a few things to help with that:

- Generate and autoload classes that Envision recognises on-the-fly.
- Uses the Ardent package automatically.
- Uses the Presenter package automatically.

### Installation

[](#installation)

Envision depends on the Ardent and the Presenter packages in your Laravel framework. So please add those packages as well. Add `shincode/envision`, Ardent and Presenter to `composer.json`.

```
"require": {
  "laravel/framework": "4.2.*",
  "shincode/envision": "dev-master",
  "laravelbook/ardent": "2.5.*",
  "robclancy/presenter": "1.3.*"
}

```

Update with composer:

```
composer update

```

Add the serviceproviders in `app/config/app.php`:

```
'Shincode\Envision\EnvisionServiceProvider',
'Robbo\Presenter\PresenterServiceProvider',

```

Copy the config file:

```
php artisan config:publish shincode/envision

```

In `app/config/packages/shincode/envision/settings.php`, set autoload and create to true to enable speed development

```
'autoload' => true,
'create' => true,

```

### Example

[](#example)

Here's a mini tutorial. Let's create a table called phones for our database. Run the follow artisan command:

```
php artisan migrate:make create_phones_table

```

Let's edit that file (keeping it simple)

```
public function up() {
	Schema::create('phones', function(Illuminate\Database\Schema\Blueprint $table) {
		$table->increments('id');
		$table->string('name');
		$table->timestamps();
	});
}

```

Run the migration

```
php artisan migrate

```

Now add this to `app/routes.php`

```
Route::controller('phone', 'PhoneController');

```

Notice how you haven't created any files yet, but instantly refer to the PhoneController. Run the application.You'll see that a `PhoneController.php` has appeared in your `app/controllers` structure.

Let's open this controller and add a function

```
public function getIndex() {
	PhoneResource::insert(array('name' => 'Sunkia'));
	PhoneResource::insert(array('name' => 'Nosy'));
	PhoneResource::insert(array('name' => 'Namnung'));
}

```

See where it's going? You never actually made the classes, you're just writing what you want to do. First we created generic routing method. Now we populate the database a little bit so we have something to work with. Since we created a controller route to 'phone', all we have to do now is to go URL `/phone` and the function will be executed. Of course we normally use a seed for this, but this way you understand how easy it is to create new entries.

The next step is to display them. Let's see how that works. Change the getIndex to something else:

```
public function getIndex() {
    $phones = PhoneResource::all();
    return View::make('phone')->with('phones', $phones);
}

```

Let's make a view file as well and save it as `view/phone.blade.php`

```
@foreach($phones as $phone)
	{{ $phone->name }}
@endforeach

```

Now open the URL to `/phone` and you'll notice it just works!

By now you should see there are a few new files created. We've been using the Resource class, the Ardent class and the Presenter class.

Let's try using the Presenter class. There should be a new folder in your app folder called 'presenters'. Open `PhonePresenter.php` and add the following function

```
public function presentFoo() {
	return 'bar';
}

```

Now let's edit `view/phone.blade.php` to

```
@foreach($phones as $phone)
	{{ $phone->name }}
	{{ $phone->foo }}
@endforeach

```

And there it is. Additional view logic right at your fingertips. For more information about the presenter, check here:

Ardent example will be added later, for now you can read about ardent here:

### Deployment

[](#deployment)

For development, having Envision is really nice. But when deploying, it's highly recommended to turn off auto-generation. In `app/config/packages/shincode/envision/settings.php` (if you have published the config) you can change the following:

- autoload = Automatically tries to find classes used by Envision. Can be left on but it has some impact on performance. For a final deployment, it's recommended to actually autoload all the files and create aliases in app.php.
- create = Automatically generate classes when not found. Highly recommended to disable when deploying for obvious reasons.
- log = Not doing anything at the moment.

I recommend using environments. For example, I use the local environment to develop and have a copy of `settings.php` in `app/config/packages/shincode/envision/local/settings.php`. By default, I have both options on disabled by default in the package, so the package is essentially 'off' on install, for safety reasons.

### Contributing To Envision

[](#contributing-to-envision)

**All issues and pull requests should be filed on the [shincode/envision](http://github.com/shincode/envision) repository.**

### License

[](#license)

Envision is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f0a0e4657ff3a6d38fc9e4275d4a54b1f937a12070b305483fb543edb899031?d=identicon)[ShinCode](/maintainers/ShinCode)

---

Top Contributors

[![ShinCode](https://avatars.githubusercontent.com/u/4114319?v=4)](https://github.com/ShinCode "ShinCode (22 commits)")[![ShinTNW](https://avatars.githubusercontent.com/u/4114517?v=4)](https://github.com/ShinTNW "ShinTNW (3 commits)")

### Embed Badge

![Health badge](/badges/shincode-envision/health.svg)

```
[![Health](https://phpackages.com/badges/shincode-envision/health.svg)](https://phpackages.com/packages/shincode-envision)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
