joselee214 / laravel
Ypc ... Components for Laravel Framework code generation. focker from reliese/laravel @ Cristian Llanos .
v0.0.26
2020-01-10 03:32 UTC
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
README
composer require joselee214/laravel
Add the service provider to your config/app.php
file within the providers
key:
// ... 'providers' => [ /* * Package Service Providers... */ Joselee214\Ypc\Joselee214ServiceProvider::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 joselee214/laravel --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(\Joselee214\Ypc\Joselee214ServiceProvider::class); } }
Models
Add the models.php
configuration file to your config
directory and clear the config cache:
php artisan vendor:publish --tag=Joselee214-models php artisan config:clear
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 connection.
php artisan zz:models
- You can scaffold a specific table like this:
php artisan zz:models --table=users
- You can also specify the connection:
php artisan zz:models --connection=mysql
- If you are using a MySQL database, you can specify which schema you want to scaffold:
php artisan zz:models --schema=shop