An efficient Laravel code generator, saving time by automating the creation of resources such as views, controllers, routes, migrations, languages, and form-requests. Highly flexible and customizable, it includes a cross-browser compatible template and client-side validation for application modernization.
An intelligent code generator for Laravel framework that will save you time! This awesome tool will help you generate resources like views, controllers, routes, migrations, languages and/or form-requests! It is extremely flexible and customizable to cover many on the use cases. It is shipped with cross-browsers compatible template, along with a client-side validation to modernize your application.
For full documentation and live demo please visit CrestApps.com
To download this package into your Laravel project, use the command-line to execute the following command
composer require crestapps/laravel-code-generator --dev
(You may skip this step when using Laravel >= 5.5) To bootstrap the packages into your project while using command-line only, open the app/Providers/AppServiceProvider.php file in your project. Then, add the following code to the register() method.
Add the following line to bootstrap laravel-code-generator
to the framework.
if ($this->app->runningInConsole()) {
$this->app->register('CrestApps\CodeGenerator\CodeGeneratorServiceProvider');
}
Checkout our channel on YouTube.com
The command in between the square brackets [] must be replaced with a variable of your choice.
Are you interested in supporting this project and making a contribution? Here’s how you can get involved:
I’d love to know if your site was generated using this package and list your logo on the documentation site. Please email using my contact info found in composer.json
file.
The following example assumes that we are trying to create a CRUD called AssetCategory with the fields listed below.
php artisan resource-file:create AssetCategory --fields=id,name,description,is_active
The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json
php artisan create:scaffold AssetCategory --with-migration
The above command will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views, the routes, and migration class!
php artisan create:scaffold AssetCategory --with-migration --fields=id,name,description,is_active
The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json first. Then, it will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views, the routes, and migration class!. This is a short way to issuing both `resource-file:create` and `create:scaffold` in one line
php artisan resource-file:create AssetCategory --fields=id,name,description,is_active
The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json
php artisan create:scaffold AssetCategory --with-migration
The above command will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views, the routes, and migration class!
php artisan resource-file:create AssetCategory --fields=id,name,description,is_active --translation-for=en,ar
The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json
php artisan create:scaffold AssetCategory --with-migration
The above command will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views, the routes, and migration class!
php artisan resource-file:create AssetCategory --fields=id,name,description,is_active
The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json
php artisan create:scaffold AssetCategory --with-form-request
The above command will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views, the routes, and app/Http/Requests/AssetCategoriesFormRequest class!
php artisan resource-file:create AssetCategory --fields=id,name,description,is_active
The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json
php artisan create:scaffold AssetCategory --with-soft-delete --with-migration
The above command will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views, the routes, and migration file!
php artisan create:scaffold AssetCategory --table-exists
The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json. It is going to assume that the table name is called "asset_categories" in your database. If that is not the case, you can use --table-name=some_other_table_name
Then it will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views and the routes!
You may also create a resource-file from existing database separately using
php artisan resource-file:from-database AssetCategory
php artisan create:scaffold AssetCategory --translation-for=en,ar --table-exists
The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json
Then it will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views and the routes!
You may also create a resource-file from existing database separately using
php artisan resource-file:from-database AssetCategory --translation-for=en,ar
php artisan resource-file:from-database AssetCategory --translation-for=en,ar
php artisan create:scaffold AssetCategory
The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json
Then it will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views and the routes!
s
“Laravel Code Generator” is an open-sourced software licensed under the MIT license