Package Data | |
---|---|
Maintainer Username: | yhbyun |
Maintainer Contact: | yonghunbyun@gmail.com (YongHun Byun) |
Package Create Date: | 2014-05-15 |
Package Last Update: | 2015-07-10 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-19 03:03:30 |
Package Statistics | |
---|---|
Total Downloads: | 198 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 12 |
Total Watchers: | 5 |
Total Forks: | 2 |
Total Open Issues: | 0 |
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
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
The snowman:scaffold
command will do a number of things for you:
php artisan snowman:scaffold acme
This single command will give you boilerplate for:
Application Folder
app/Acme/Providers/RepoServiceProvider.php
app/Acme/Repos/BaseRepoInterface.php
app/Acme/Repos/Eloquent/BaseRepo.php
The snowman:resource
command will do a number of things for you:
RepoServiceProvider.php
php artisan snowman:resource acme post
This single command will do the following work:
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:
<?php
return [
/*
|--------------------------------------------------------------------------
| Where the templates for the generators are stored...
|--------------------------------------------------------------------------
|
*/
'model_template_path' => '/Users/yhbyun/my-project/app/templates/model.txt',
'repo_template_path' => '/Users/yhbyun/my-project/app/templates/repo.txt',
'repo_interface_template_path' => '/Users/yhbyun/my-project/app/templates/repo_interface.txt',
'baserepo_template_path' => '/Users/yhbyun/my-project/app/templates/baserepo.txt',
'baserepo_interface_template_path' => '/Users/yhbyun/my-project/app/templates/baserepo_interface.txt',
'presenter_template_path' => '/Users/yhbyun/my-project/app/templates/presenter.txt',
'reposerviceprovider_template_path' => '/Users/yhbyun/my-project/app/templates/reposerviceprovider.txt',
/*
|--------------------------------------------------------------------------
| Where the generated files will be saved...
|--------------------------------------------------------------------------
|
*/
'target_parant_path' => app_path(),
];
Also, while you're in this file, note that you can also update the default target directory for each generator.
This package is based upon a Jeffrey Way's generators, which is an indispensable packgage in Laravel.