dam1r89/proto-generator
Laravel 5 prototyping tool. Creates files based on the templates. It comes with template for views, model, migration and controllers.
265
6
| Install | |
|---|---|
composer require dam1r89/proto-generator |
|
| Latest Version: | 2.0.14 |
| PHP: | >=5.4.0 |
| Laravel: | 5 |
| Last Updated: | Jul 20, 2017 |
| Links: | GitHub · Packagist |
Maintainer: dam1r89
Install
composer require "dam1r89/proto-generator" --dev
Add to config/app.php under the providers key, but before application providers.
dam1r89\ProtoGenerator\ProtoGeneratorServiceProvider::class,
If you want to edit templates you can publish them.
php artisan vendor:publish --tag="proto-generator"
Example
To scaffold resource with name post you type:
php artisan proto post --fields='{"name":{}, "body":{}, "rating": {"type": "number"}}'
fields flag is json data which is transferred to the templates.
and add bindings to the routes.php file:
Route::resource('post', 'PostsController');
then go to local serving address, for example on http://localhost:8000/posts and you can see simple crud application.
For hasOne relation use field name and id: "category_id": {"label": "name"}.
Flags
-r replace files withouth asking
-t template folder - default standard
-f fields
-d additional context data
-o output folder - default base
Using from app
use dam1r89\ProtoGenerator\ContextDataParser;
use dam1r89\ProtoGenerator\Proto;
$parser = new ContextDataParser('users', ['first_name', 'last_name']);
$context = $parser->getContextData();
$context['additional_data'] = 'whatever';
$p = Proto::create('source/path/', base_path(), $context);
$p->generate(true);
Related Packages
amptech/laravel-blade-scaffold
Generador automático de vistas CRUD Blade para Laravel con componentes reutiliza...
17
0
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 2.0.14 | >=5.4.0 | ~5.0 | ||
| 2.0.13 | >=5.4.0 | ~5.0 | ||
| 2.0.12 | >=5.4.0 | ~5.0 | ||
| 2.0.11 | >=5.4.0 | ~5.0 | ||
| 2.0.10 | >=5.4.0 | ~5.0 | ||
| 2.0.9 | >=5.4.0 | ~5.0 | ||
| 2.0.8 | >=5.4.0 | ~5.0 | ||
| 2.0.7 | >=5.4.0 | ~5.0 | ||
| 2.0.6 | >=5.4.0 | ~5.1 | ||
| 2.0.5 | >=5.4.0 | 5.0.* | ||
| 2.0.4 | >=5.4.0 | 5.0.* | ||
| 2.0.3 | >=5.4.0 | 5.0.* | ||
| 2.0.2 | >=5.4.0 | 5.0.* | ||
| 2.0.1 | >=5.4.0 | 5.0.* | ||
| 2.0 | >=5.4.0 | 5.*.* | ||
| 1.0.12 | >=5.4.0 | ~5.0 | ||
| 1.0.0 | >=5.4.0 | 5.*.* |