PHPackages                             yhbyun/snowman - 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. yhbyun/snowman

ActiveLibrary[Framework](/categories/framework)

yhbyun/snowman
==============

Laravel 4 Repository Pattern Generator

V0.1.1(12y ago)121992MITPHPPHP &gt;=5.3.0

Since May 20Pushed 10y ago4 watchersCompare

[ Source](https://github.com/yhbyun/laravel-snowman)[ Packagist](https://packagist.org/packages/yhbyun/snowman)[ RSS](/packages/yhbyun-snowman/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

Fast Workflow in Laravel With Repository Pattern Generators
===========================================================

[](#fast-workflow-in-laravel-with-repository-pattern-generators)

[![Build Status](https://camo.githubusercontent.com/2da3582d5c23b7de4f629057fa0ea1c99f3d2b4b077a8f11d9771e46153a8093/68747470733a2f2f7472617669732d63692e6f72672f79686279756e2f6c61726176656c2d736e6f776d616e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/yhbyun/laravel-snowman)

This Laravel package provides a variety of generators to speed up your development process. These generators include:

- `snowman:baserepo`
- `snowman:baserepointerface`
- `snowman:model`
- `snowman:presenter`
- `snowman:repo`
- `snowman:repointerface`
- `snowman:reposerviceprovider`
- `snowman:resource`
- `snowman:scaffold`

Requirements
------------

[](#requirements)

- PHP 5.4+
- Laravel 4.2

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

[](#installation)

Begin by installing this package through Composer. Edit your project's `composer.json` file to require `yhbyun/snowman`.

```
"require-dev": {
	"yhbyun/snowman": "dev-master"
}

```

Next, update Composer from the Terminal:

```
composer update --dev

```

Once this operation completes, the final step is to add the service provider. Open `app/config/app.php`, and add a new item to the providers array.

```
'Yhbyun\Snowman\SnowmanServiceProvider'

```

That's it! You're all set to go. Run the `artisan` command from the Terminal to see the new `snowman` commands.

```
php artisan

```

Usage
-----

[](#usage)

- [Scaffolding](#scaffolding)
- [Resources](#resources)
- [Configuration](#configuration)

### Scaffolding

[](#scaffolding)

The `snowman:scaffold` command will do a number of things for you:

- Generate a application folder
- Generate a base repository
- Generate a base repository interface
- Generate a repository service provider

#### Example

[](#example)

```
php artisan snowman:scaffold acme
```

This single command will give you boilerplate for:

- Application Folder

    - app/Acme
    - app/Acme/Presenters
    - app/Acme/Providers
    - app/Acme/Repos
    - app/Acme/Repos/Eloquent
- app/Acme/Providers/RepoServiceProvider.php
- app/Acme/Repos/BaseRepoInterface.php
- app/Acme/Repos/Eloquent/BaseRepo.php

### Resources

[](#resources)

The `snowman:resource` command will do a number of things for you:

- Generate a model
- Generate a model repository
- Generate a model repository interface
- Generate a model presenter
- Add binding in `RepoServiceProvider.php`

#### Example

[](#example-1)

```
php artisan snowman:resource acme post
```

This single command will do the following work:

- app/Acme/Presenters/PostPresenter.php
- app/Acme/Providers/RepoServiceProvider.php : add binding
- app/Acme/Repos/PostRepoInterface.php
- app/Acme/Repos/Eloquent/PostRepo.php
- app/Acme/Post.php

### Configuration

[](#configuration)

You may want to modify your templates - how the generated files are formatted. To allow for this, you need to publish the templates that, behind the scenes, the generators will reference.

```
php artisan snowman:publish-templates
```

This will copy all templates to your `app/templates` directory. You can modify these however you wish to fit your desired formatting. If you'd prefer a different directory:

```
php artisan snowman:publish-templates --path=app/foo/bar/templates
```

When you run the `snowman:publish-templates` command, it will also publish the configuration to `app/config/packages/yhbyun/snowman/config/config.php`. This file will look somewhat like:

```
