2017 © Pedro Peláez
 

library app-creator

Laravel Framework code generation.

image

gesirdek/app-creator

Laravel Framework code generation.

  • Friday, July 27, 2018
  • by gesirdek
  • Repository
  • 2 Watchers
  • 2 Stars
  • 58 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 88 Forks
  • 0 Open issues
  • 40 Versions
  • 53 % Grown

The README.md

App-Creator

App-Creator is a collection of Laravel Components which aim is to create Laravel 5.6 and Vue2 application from database., (*1)

How does it work?

This package expects that you are using Laravel 5.6+ and already have a fresh Laravel installation with a database that has tables with Laravel naming convention. Then You will need to import the app-creator package via composer:, (*2)

composer require gesirdek/app-creator

Configuration

Add the service provider to your config/app.php file within the providers key:, (*3)

// ...
'providers' => [
    /*
     * Package Service Providers...
     */

    Gesirdek\Coders\CodersServiceProvider::class,
],
// ...

Configuration for local environment only

If you wish to enable generators only for your local environment, you should install it via composer using the --dev option like this:, (*4)

composer require gesirdek/app-creator --dev

Then you'll need to register the provider in app/Providers/AppServiceProvider.php file., (*5)

public function register()
{
    if ($this->app->environment() == 'local') {
        $this->app->register(Gesirdek\Coders\CodersServiceProvider::class);
    }
}

Models

Add the models.php configuration file to your config directory., (*6)

php artisan vendor:publish --tag=gesirdek-models --force
php artisan config:clear

Admin Panel

Add this to your routes.php or web.php depending on your laravel verison., (*7)

Route::get('admin/{name?}', function ($name='') {
    return view('admin');
})->where('name','.*');

Database Creation

To be able to create project from database, consider below for database design., (*8)

  • Table names need to be plural form except pivot table names.
  • Pivot table names must include both tables' name as singular form.
  • To implement modular design, add module name to table comment. If you need to add a comment to any table, add double semicolon (;;) before your comment.

To be able to use modular design, add nWidart package, (*9)

composer require nwidart/laravel-modules

After that add modules directory ("Modules\\": "Modules/") to composer.json, (*10)

{
"autoload": {
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "psr-4": {
            "App\\": "app/",
            "Modules\\": "Modules/"
        }
    },
}

After that run composer dumpautoload, (*11)

composer dumpautoload

Usage

Assuming you have already configured your database, you are now all set to go., (*12)

  • Let's scaffold some of your models from your default (mysql) connection.
php artisan code:models

If you are using POSTGRESQL, (*13)

php artisan code:models --connection=pgsql

Then run, (*14)

npm run production

Thats it! Your admin panel with DB CRUD's is ready under /admin !, (*15)

Customizing Model Scaffolding

To change the scaffolding behaviour you can make config/models.php configuration file fit your database needs., (*16)

Tips

1. Keeping model changes

You may want to generate your models as often as you change your database. In order not to lose you own model changes, you should set base_files to true in your config/models.php., (*17)

When you enable this feature your models will inherit their base configurations from base models. You should avoid adding code to your base models, since you will lose all changes when they are generated again., (*18)

Note: You will end up with to models for the same table and you may think it is a horrible idea to have two classes for the same thing. However, it is up to you to decide whether this approach gives value to your project :-), (*19)

Support

For the time being, this package supports Postgre and MYSQL database., (*20)

The Versions

27/07 2018
08/06 2018
19/04 2018
19/04 2018
19/04 2018
19/04 2018
19/04 2018
19/04 2018
19/04 2018
18/04 2018
18/04 2018
18/04 2018
18/04 2018
17/04 2018
13/04 2018
13/04 2018
13/04 2018
11/04 2018
11/04 2018
11/04 2018
06/04 2018
06/04 2018
06/04 2018
06/04 2018
06/04 2018
06/04 2018

dev-add-license-1

dev-add-license-1

Laravel Framework code generation.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ertan Çoban

gesirdek app-creator

06/04 2018
04/02 2017
09/01 2017
01/11 2016
01/11 2016
24/10 2016
24/10 2016
23/10 2016
20/10 2016
17/10 2016
17/10 2016
17/10 2016
17/10 2016