gesirdek / app-creator
Laravel Framework code generation.
Installs: 139
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 326
Open Issues: 2
Language:Shell
Requires
- php: >=5.6.4
- doctrine/dbal: ~2.5
- illuminate/console: ~5.1
- illuminate/contracts: ~5.1
- illuminate/database: ~5.1
- illuminate/filesystem: ~5.1
- illuminate/support: ~5.1
Requires (Dev)
- fzaninotto/faker: ~1.4
- mockery/mockery: 0.9.*
- phpunit/phpunit: ~5.0
- dev-master
- v0.1.48
- v0.1.47
- v0.1.46
- v0.1.45
- v0.1.44
- v0.1.43
- v0.1.42
- v0.1.41
- v0.1.40
- v0.1.39
- v0.1.38
- v0.1.37
- v0.1.36
- v0.1.35
- v0.1.34
- v0.1.33
- v0.1.32
- v0.1.31
- v0.1.30
- v0.1.29
- v0.1.28
- v0.1.27
- v0.1.26
- v0.1.25
- v0.1.24
- v0.1.23
- v0.1.22
- v0.1.21
- v0.1.20
- v0.1.19
- v0.1.18
- v0.1.17
- v0.1.16
- v0.1.15
- v0.1.14
- v0.1.13
- v0.0.13
- v0.0.12
- v0.0.11
- v0.0.10
- v0.0.9
- v0.0.8
- v0.0.7
- v0.0.6
- v0.0.5
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
- dev-add-license-1
This package is auto-updated.
Last update: 2025-04-20 17:16:02 UTC
README
App-Creator is a collection of Laravel Components which aim is to create Laravel 5.6 and Vue2 application from database.
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:
composer require gesirdek/app-creator
Configuration
Add the service provider to your config/app.php
file within the providers
key:
// ... '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:
composer require gesirdek/app-creator --dev
Then you'll need to register the provider in app/Providers/AppServiceProvider.php
file.
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.
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.
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.
- 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
composer require nwidart/laravel-modules
After that add modules directory ("Modules\\": "Modules/"
) to composer.json
{ "autoload": { "classmap": [ "database/seeds", "database/factories" ], "psr-4": { "App\\": "app/", "Modules\\": "Modules/" } }, }
After that run composer dumpautoload
composer dumpautoload
Usage
Assuming you have already configured your database, you are now all set to go.
- Let's scaffold some of your models from your default (mysql) connection.
php artisan code:models
If you are using POSTGRESQL
php artisan code:models --connection=pgsql
Then run
npm run production
Thats it! Your admin panel with DB CRUD's is ready under /admin !
Customizing Model Scaffolding
To change the scaffolding behaviour you can make config/models.php
configuration file
fit your database needs.
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
.
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.
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 :-)
Support
For the time being, this package supports Postgre and MYSQL database.