2017 © Pedro PelĆ”ez
 

library generator

Generator for HaziCms.

image

hazicms/generator

Generator for HaziCms.

  • Wednesday, May 27, 2015
  • by aitiba
  • Repository
  • 1 Watchers
  • 5 Stars
  • 47 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Steps to Get Started

  1. Add this package to your composer.json:, (*1)

    "require": {
        "pingpong/generators": "2.0.*@dev",
        "pingpong/modules": "2.0.x-dev",
        "hazicms/generator": "1.0.x"
    }
  2. Run composer update, (*2)

    composer update
  3. Add the ServiceProviders to the providers array in config/app.php.
    , (*3)

    'Laracasts\Flash\FlashServiceProvider',
    'Mitul\Generator\GeneratorServiceProvider',
    'Pingpong\Modules\ModulesServiceProvider',
    'Pingpong\Modules\Providers\BootstrapServiceProvider',
    'HaziCms\Generator\Generator\GeneratorServiceProvider',
    'Collective\Html\HtmlServiceProvider',
    'Intervention\Image\ImageServiceProvider',

    Also for convenience, add these facades in alias array in config/app.php., (*4)

    'Module'=> 'Pingpong\Modules\Facades\Module',
    'Form' => 'Collective\Html\FormFacade',
    'Html' => 'Collective\Html\HtmlFacade',
    'Flash' => 'Laracasts\Flash\Flash',
    'Image' => 'Intervention\Image\Facades\Image'
  4. Publish config files for generators, modules and images:, (*5)

    php artisan vendor:publish --provider="HaziCms\Generator\Generator\GeneratorServiceProvider"
    
    php artisan vendor:publish
    
    php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravel5"
  5. Modify modules.php file to your needs.On Cms, change 'namespace' => 'HaziCms\Modules', and 'modules' => app_path('Modules')., (*6)

  6. Modify generator.php file to your needs., (*7)

  7. Add ADMIN-LTE dashboard template: cd public && bower update && cd .., (*8)

  8. Add bower dependencies (at least CKEditor): cd vendor/hazicms/generator/ && bower update && cd .., (*9)

  9. Fire artisan command to generate module with model., (*10)

    php artisan hazicms:generator ModuleName ModelName

    e.g., (*11)

    php artisan hazicms:generator Network Project
    php artisan hazicms:generator Blog Post
  10. Enter the fields with options
    , (*12)

    fieldName:fieldType[,htmlAtribute1 ,htmlAtribute2]:[fieldData]:[defaultOption], (*13)

    Examples:, (*14)

    Select: group:select,'id' => 'mySelect', 'class' => 'red':['admin' => 'admin','user' => 'user']:user
    Select (data from model): role_id:select,'id' => 'mySelect', 'class' => 'red'  //to run well, need the fathers model created. Role for this example
    Text: title:text,'size' => 255
    Hidden: user_id:hidden,'id'=> 'user_id' // if the name ends with '_id', we suppose that the value is the model id. // Else value is null
    Float: price:float,'min' => 1, 'max' => 10
    Textarea: body:textarea,'placeholder' => 'Body content' (make ```bower install``` inside generator folder)
    Radiobutton: sex:radio,'id' => 'sex', 'class' => 'red':['male' => 'ale','female' => 'fem']:fem
    Checkbutton: data:check,'id' => 'data', 'class' => 'red':['clean_the_room' => 'clean','go_to_your_home' => 'home']:home (*)
    Number: assistance:number,'id' => 'assistance', 'class' => 'red'
    Date: birthday:date,'id' => 'date', 'class' => 'red' (make ```bower install``` inside generator folder)

    There are some basic field examples on field_example_data file., (*15)

(*) Need to uncomment 3 lines on the modules controller to run. Laravelcollective/form has a bug with checkboxes. Until this been solved, this trick is needed! :-( If you see "preg_replace(): Parameter mismatch, pattern is a string while replacement is an array" error, you need to read the last sentece. :-), (*16)

  1. (optional) If you want, you can add auth middleware to module routes. Route::group(['prefix' => 'admin', 'middleware' => 'auth') ..., (*17)

  2. Go to http://domain.com/admin/[Plural's ModelName] :), (*18)

Use ROXY fileman[0] as a filebrowser for CKEditor

  1. Download fileman for PHP, unzip on public folder and give permissions., (*19)

  2. Add on: /public/theme/ckeditor/config.js, (*20)

    var roxyFileman = '/fileman/index.html';
    config.filebrowserBrowseUrl = roxyFileman;
    config.filebrowserImageBrowseUrl = roxyFileman+'?type=image';
    config.removeDialogTabs = 'link:upload;image:upload';
  3. On public/fileman/conf.json change INTEGRATION to "ckeditor"., (*21)

[0] http://www.roxyfileman.com/CKEditor-file-browser, (*22)

Use outsite of HaziCms namespace

  1. php artisan app:name your_namespace., (*23)

  2. Set on config/generator.php file, namespace variable to your_namespace., (*24)

Credits

This module generator is created by Aitor IbaƱez., (*25)

This package is based on laravel-api-generator., (*26)

Bugs & Forks are welcomed :), (*27)

The Versions

27/05 2015

dev-master

9999999-dev https://github.com/hazicms/generator

Generator for HaziCms.

  Sources   Download

GPL-3.0

The Requires

 

laravel api crud generator migration model scaffold cms

19/05 2015

v1.0.3

1.0.3.0 https://github.com/hazicms/generator

Generator for HaziCms.

  Sources   Download

GPL-3.0

The Requires

 

laravel api crud generator migration model scaffold cms

14/05 2015

v1.0.2

1.0.2.0 https://github.com/hazicms/generator

Generator for HaziCms.

  Sources   Download

GPL-3.0

The Requires

 

laravel api crud generator migration model scaffold cms

11/05 2015

v1.0.1

1.0.1.0 https://github.com/hazicms/generator

Generator for HaziCms.

  Sources   Download

GPL-3.0

The Requires

 

laravel api crud generator migration model scaffold cms

10/05 2015

v1.0

1.0.0.0 https://github.com/hazicms/generator

Generator for HaziCms.

  Sources   Download

GPL-3.0

The Requires

 

laravel api crud generator migration model scaffold cms

21/04 2015

v0.9

0.9.0.0 https://github.com/aitiba/laravelapigeneratorextend

Laravel Module Generator.

  Sources   Download

GPL v2

The Requires

 

laravel api crud generator migration model scaffold