Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 22 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@

## Introduction

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.
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 use cases. It is shipped with a cross-browser compatible template, along with client-side validation to modernize your application.

For full documentation and live demo please visit <a href="https://crestapps.com/laravel-code-generator/docs/2.2" target="_blank" title="Laravel Code Generator Documentation">CrestApps.com</a>
For full documentation and live demo, please visit <a href="https://crestapps.com/laravel-code-generator/docs/2.2" target="_blank" title="Laravel Code Generator Documentation">CrestApps.com</a>

## Features

<ul>
<li>Create very clean, reusable and highly readable code to build on.</li>
<li>Create full resources using a single command with <strong>migration</strong> or from <strong>existing database</strong>.</li>
<li>Creates full resources for all of the existing tables in the database using one command.</li>
<li>Allows you to save the fields in a JSON file and recreate resources when the business needs changes.</li>
<li>Allows you to save the fields in a JSON file and recreate resources when the business needs change.</li>
<li>Utilizes JSON based resource-file to allow you to define your resources. Resource-file allows you to easily regenerate the resource at any time even when the business rules change.</li>
<li>Create standard CRUD controllers with simple or form-request validation.</li>
<li>Customizable view’s templates to enable you to change the standard look and feel of your application.</li>
<li>Create model with relations.</li>
<li>Create named routes with and without group.</li>
<li>Create standard CRUD views.</li>
<li>Smart migration engine! Keeps track of all generated migrations to only create the needed migration.</li>
<li>Intelligent enough to automatically handles the relations between the models.</li>
<li>Intelligent enough to automatically handle the relations between the models.</li>
<li>Very flexible and rich with configurable options.</li>
<li>Easy commands to create resource-file; additionally, add or reduce existing resource-file.</li>
<li>Full capability to generate multi-languages applications.</li>
<li>Full capability to generate multi-language applications.</li>
<li>Client-side validation.</li>
<li>File uploading handling.</li>
<li>Auto store multiple-response in the database.</li>
Expand All @@ -38,7 +38,7 @@ For full documentation and live demo please visit <a href="https://crestapps.com

## Installation

1. To download this package into your laravel project, use the command-line to execute the following command
1. To download this package into your laravel project, use the command-line to execute the following command:

```
composer require crestapps/laravel-code-generator --dev
Expand All @@ -60,7 +60,8 @@ For full documentation and live demo please visit <a href="https://crestapps.com
php artisan vendor:publish --provider="CrestApps\CodeGenerator\CodeGeneratorServiceProvider" --tag=default
```

> A layout is required for the default views! The code generator allows you to create a layout using the command-line. Of cource you can use your own layout. You'll only need to include [CSS bootstrap framework](http://getbootstrap.com/ "CSS bootstrap framework") in your layout for the default templates to work properly. Additionally, you can chose to you design your own templetes using a different or no css framework.

> A layout is required for the default views! The code generator allows you to create a layout using the command-line. Of course, you can use also your own layout. You'll only need to include [CSS bootstrap framework](http://getbootstrap.com/ "CSS bootstrap framework") in your layout for the default templates to work properly. Additionally, you can chose to design your own templetes using a different framework or css.

## Lessons
Checkout our channel on <a href="https://www.youtube.com/channel/UCkEd0nOoRf3o0ahspAu7Y9w/videos" target="_blank" title="CrestApps YouTube Channel">YouTube.com</a>
Expand Down Expand Up @@ -128,11 +129,11 @@ Checkout our channel on <a href="https://www.youtube.com/channel/UCkEd0nOoRf3o0a
## Contribution
Do you like this project and want to contribute?
- Please start by *Staring* this package on GitHub.
- Sharing this projects with others is your way of saying keep improvements and new awesome feature coming.
- Sharing this projects with others is your way of saying keep the improvements and new awesome features coming.
- Report any bugs or send us any comments, idea, thought that you may have about this project as an issue on GitHub.

## What did you create with this package?
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.
I'd love to know if your site was generated using this package and list your logo on the documentation site. Please email me by using my contact info found in `composer.json` file.

## Examples

Expand All @@ -148,7 +149,7 @@ The following example assumes that we are trying to create a CRUD called <var>As

<blockquote>
<p><code>php artisan resource-file:create AssetCategory --fields=id,name,description,is_active</code></p>
<p><small>The above command will create resource-file names <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
<p><small>The above command will create a resource-file named <code>asset_categories</code>, and will save it here <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
<p><code>php artisan create:resources AssetCategory --with-migration</code></p>
<p><small>The above command will create a model <var>app/Models/AssetCategory</var>, a controller <var>app/Http/Controllers/AssetCategoriesController, all views, the routes, and migration class!</var></small></p>
</blockquote>
Expand All @@ -158,7 +159,7 @@ The following example assumes that we are trying to create a CRUD called <var>As

<blockquote>
<p><code>php artisan resource-file:create AssetCategory --fields=id,name,description,is_active --translation-for=en,ar</code></p>
<p><small>The above command will create resource-file names <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
<p><small>The above command will create resource-file named <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
<p><code>php artisan create:resources AssetCategory --with-migration</code></p>
<p><small>The above command will create a model <var>app/Models/AssetCategory</var>, a controller <var>app/Http/Controllers/AssetCategoriesController, all views, the routes, and migration class!</var></small></p>
</blockquote>
Expand All @@ -167,7 +168,7 @@ The following example assumes that we are trying to create a CRUD called <var>As

<blockquote>
<p><code>php artisan resource-file:create AssetCategory --fields=id,name,description,is_active</code></p>
<p><small>The above command will create resource-file names <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
<p><small>The above command will create resource-file named <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
<p><code>php artisan create:resources AssetCategory --with-form-request</code></p>
<p><small>The above command will create a model <var>app/Models/AssetCategory</var>, a controller <var>app/Http/Controllers/AssetCategoriesController, all views, the routes, and <var>app/Http/Requests/AssetCategoriesFormRequest</var> class!</var></small></p>
</blockquote>
Expand All @@ -176,7 +177,7 @@ The following example assumes that we are trying to create a CRUD called <var>As

<blockquote>
<p><code>php artisan resource-file:create AssetCategory --fields=id,name,description,is_active</code></p>
<p><small>The above command will create resource-file names <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
<p><small>The above command will create resource-file named <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
<p><code>php artisan create:resources AssetCategory --with-soft-delete --with-migration</code></p>
<p><small>The above command will create a model <var>app/Models/AssetCategory</var>, a controller <var>app/Http/Controllers/AssetCategoriesController, all views, the routes, and migration file!</var></small></p>
</blockquote>
Expand All @@ -185,29 +186,29 @@ The following example assumes that we are trying to create a CRUD called <var>As

<blockquote>
<p><code>php artisan create:resources AssetCategory --table-exists</code></p>
<p><small>The above command will create resource-file names <var>/resources/laravel-code-generator/sources/asset_categories.json</var>. 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 <var>--table-name=some_other_table_name</var></small></p>
<p><small>The above command will create resource-file named <var>/resources/laravel-code-generator/sources/asset_categories.json</var>. It is going to assume that the table name is called "asset_categories" in your database. Note, it assumes your table is plural. If that is not the case, you can use <var>--table-name=some_other_table_name</var></small></p>

<p><small>Then it will create a model <var>app/Models/AssetCategory</var>, a controller <var>app/Http/Controllers/AssetCategoriesController, all views and the routes!</var></small></p>
<p><small>You may also create a resource-file from existing database separately using <code>php artisan resource-file:form-database AssetCategory</code></small></p>
<p><small>Then it will create a model <var>app/Models/AssetCategory</var>, a controller <var>app/Http/Controllers/AssetCategoriesController, all views and routes!</var></small></p>
<p><small>You may also create a resource-file from existing database separately using <code>php artisan resource-file:from-database AssetCategory</code></small></p>
</blockquote>


### Creating resources from existing database with translation for English and Arabic

<blockquote>
<p><code>php artisan create:resources AssetCategory --translation-for=en,ar --table-exists</code></p>
<p><small>The above command will create resource-file names <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
<p><small>The above command will create resource-file named <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
<p><small>Then it will create a model <var>app/Models/AssetCategory</var>, a controller <var>app/Http/Controllers/AssetCategoriesController, all views and the routes!</var></small></p>
<p><small>You may also create a resource-file from existing database separately using <code>php artisan resource-file:form-database AssetCategory --translation-for=en,ar</code></small></p>
<p><small>You may also create a resource-file from existing database separately using <code>php artisan resource-file:from-database AssetCategory --translation-for=en,ar</code></small></p>
</blockquote>

### Creating resources from existing database with translation for English and Arabic in two step for better control over the fields!

<blockquote>
<p><code>php artisan resource-file:form-database AssetCategory --translation-for=en,ar</code></p>
<p><code>php artisan resource-file:from-database AssetCategory --translation-for=en,ar</code></p>
<p><code>php artisan create:resources AssetCategory</code></p>
<p><small>The above command will create resource-file names <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
<p><small>Then it will create a model <var>app/Models/AssetCategory</var>, a controller <var>app/Http/Controllers/AssetCategoriesController, all views and the routes!</var></small></p>
<p><small>The above command will create resource-file named <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
<p><small>Then it will create a model <var>app/Models/AssetCategory</var>, a controller <var>app/Http/Controllers/AssetCategoriesController, all views and routes!</var></small></p>
</blockquote>


Expand Down