Skip to content

Commit d44f3b0

Browse files
committed
Complete the merge between v2.3 into master
1 parent 55ec24c commit d44f3b0

File tree

6 files changed

+9
-94
lines changed

6 files changed

+9
-94
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## v2.3.0
1+
## v2.3 - v2.4
22
- The `create:resources` command have been renamed to `create:scaffold`.
33
- The `--fields` option was added to the `create:scaffold` to allow you to scaffold everything using a single command. So you can use the `create:scaffold` command to create resource-file and scaffold all at the same time. For example, `php artisan create:scaffold Test --fields=id,first_field,second_field`. The previous command will first create the resource-file before it create your other resources. The `--fields` option should only be used one time only to create the resource-file not every time.
44
- The default value of the option `controller-extends` in the `create:controller` command was changed from `Http\Controllers\Controller` to `default-controller`.

README.md

Lines changed: 6 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=An%20intelligent%20code%20generator%20for%20Laravel%20framework%20which%20will%20save%20you%20lots%20of%20time!&url=https://github.com/CrestApps/laravel-code-generator&hashtags=laravel,laravel-code-generator,laravel-crud,code-generator,crud-generator,laravel-crud-generator)
21

32
[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=An%20intelligent%20code%20generator%20for%20Laravel%20framework%20which%20will%20save%20you%20lots%20of%20time!&url=https://github.com/CrestApps/laravel-code-generator&hashtags=laravel,laravel-code-generator,laravel-crud,code-generator,crud-generator,laravel-crud-generator)
43

54
## Introduction
65

7-
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.
6+
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.
87

9-
<<<<<<< HEAD
10-
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>
11-
=======
128
For full documentation and live demo please visit <a href="https://crestapps.com/laravel-code-generator/docs/2.3" target="_blank" title="Laravel Code Generator Documentation">CrestApps.com</a>
13-
>>>>>>> v2.3
9+
10+
**Note: ** The available documentation is for versions <= 2.2. The documentation for vertion 2.3+ is very similar with some exceptions. Please review the <a href="https://github.com/CrestApps/laravel-code-generator/blob/master/CHANGELOG.md" title="ChangeLog">Change Log</a> to get a list of the changes.
1411

1512
## Features
1613

@@ -19,25 +16,21 @@ For full documentation and live demo please visit <a href="https://crestapps.com
1916
<li>Create very clean, reusable and highly readable code to build on.</li>
2017
<li>Create full resources using a single command with <strong>migration</strong> or from <strong>existing database</strong>.</li>
2118
<li>Creates full resources for all of the existing tables in the database using one command.</li>
22-
<<<<<<< HEAD
23-
<li>Allows you to save the fields in a JSON file and recreate resources when the business needs change.</li>
24-
=======
2519
<li>Create full API-based resources using a single command with <strong>migration</strong> or from <strong>existing database</strong>.</li>
2620
<li>Create beautiful documentation for your API.</li>
2721
<li>Create api-resource and api-resource-collection with Laravel 5.5+.</li>
2822
<li>Allows you to save the fields in a JSON file and recreate resources when the business needs changes.</li>
29-
>>>>>>> v2.3
3023
<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>
3124
<li>Create standard CRUD controllers with simple or form-request validation.</li>
3225
<li>Customizable view’s templates to enable you to change the standard look and feel of your application.</li>
3326
<li>Create model with relations.</li>
3427
<li>Create named routes with and without group.</li>
3528
<li>Create standard CRUD views.</li>
3629
<li>Smart migration engine! Keeps track of all generated migrations to only create the needed migration.</li>
37-
<li>Intelligent enough to automatically handle the relations between the models.</li>
30+
<li>Intelligent enough to automatically handles the relations between the models.</li>
3831
<li>Very flexible and rich with configurable options.</li>
3932
<li>Easy commands to create resource-file; additionally, add or reduce existing resource-file.</li>
40-
<li>Full capability to generate multi-language applications.</li>
33+
<li>Full capability to generate multi-languages applications.</li>
4134
<li>Client-side validation.</li>
4235
<li>File uploading handling.</li>
4336
<li>Auto store multiple-response in the database.</li>
@@ -52,7 +45,7 @@ For full documentation and live demo please visit <a href="https://crestapps.com
5245

5346
## Installation
5447

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

5750
```
5851
composer require crestapps/laravel-code-generator --dev
@@ -68,18 +61,7 @@ For full documentation and live demo please visit <a href="https://crestapps.com
6861
}
6962
```
7063

71-
<<<<<<< HEAD
72-
3. Execute the following command from the command-line to publish the package's config and the default template to start generating awesome code.
73-
74-
```
75-
php artisan vendor:publish --provider="CrestApps\CodeGenerator\CodeGeneratorServiceProvider" --tag=default
76-
```
77-
78-
79-
> 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.
80-
=======
8164
> 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.
82-
>>>>>>> v2.3
8365
8466
## Lessons
8567
Checkout our channel on <a href="https://www.youtube.com/channel/UCkEd0nOoRf3o0ahspAu7Y9w/videos" target="_blank" title="CrestApps YouTube Channel">YouTube.com</a>
@@ -163,16 +145,6 @@ Do you like this project and want to contribute?
163145
## What did you create with this package?
164146
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.
165147

166-
## Contribution
167-
Do you like this project and want to contribute?
168-
- **HELP WANTED** Version `v2.3` needs to be documented before it can be released. If you are able to contribute, please read the <a href="https://github.com/CrestApps/laravel-code-generator/blob/v2.3/CHANGELOG.md">change-log</a> in <a href="https://github.com/CrestApps/laravel-code-generator/tree/v2.3">v2.3 branch</a> and document it in the <a href="https://github.com/CrestApps/crestapps-site">CrestApps-site</a> repository. For any help, my email can be found in the `composer.json` file, feel free to send me an email.
169-
- Please start by ***Staring*** this package on GitHub.
170-
- Sharing this projects with others is your way of saying keep the improvements and new awesome features coming.
171-
- Report any bugs or send us any comments, idea, thought that you may have about this project as an issue on GitHub.
172-
173-
## What did you create with this package?
174-
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.
175-
176148
## Examples
177149

178150
The following example assumes that we are trying to create a CRUD called <var>AssetCategory</var> with the fields listed below.
@@ -187,13 +159,8 @@ The following example assumes that we are trying to create a CRUD called <var>As
187159

188160
<blockquote>
189161
<p><code>php artisan resource-file:create AssetCategory --fields=id,name,description,is_active</code></p>
190-
<<<<<<< HEAD
191-
<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>
192-
<p><code>php artisan create:resources AssetCategory --with-migration</code></p>
193-
=======
194162
<p><small>The above command will create resource-file names <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
195163
<p><code>php artisan create:scaffold AssetCategory --with-migration</code></p>
196-
>>>>>>> v2.3
197164
<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>
198165
</blockquote>
199166

@@ -218,72 +185,45 @@ The following example assumes that we are trying to create a CRUD called <var>As
218185

219186
<blockquote>
220187
<p><code>php artisan resource-file:create AssetCategory --fields=id,name,description,is_active --translation-for=en,ar</code></p>
221-
<<<<<<< HEAD
222-
<p><small>The above command will create resource-file named <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
223-
<p><code>php artisan create:resources AssetCategory --with-migration</code></p>
224-
=======
225188
<p><small>The above command will create resource-file names <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
226189
<p><code>php artisan create:scaffold AssetCategory --with-migration</code></p>
227-
>>>>>>> v2.3
228190
<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>
229191
</blockquote>
230192

231193
#### Basic example with form-request
232194

233195
<blockquote>
234196
<p><code>php artisan resource-file:create AssetCategory --fields=id,name,description,is_active</code></p>
235-
<<<<<<< HEAD
236-
<p><small>The above command will create resource-file named <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
237-
<p><code>php artisan create:resources AssetCategory --with-form-request</code></p>
238-
=======
239197
<p><small>The above command will create resource-file names <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
240198
<p><code>php artisan create:scaffold AssetCategory --with-form-request</code></p>
241-
>>>>>>> v2.3
242199
<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>
243200
</blockquote>
244201

245202
#### Basic example with soft-delete and migration
246203

247204
<blockquote>
248205
<p><code>php artisan resource-file:create AssetCategory --fields=id,name,description,is_active</code></p>
249-
<<<<<<< HEAD
250-
<p><small>The above command will create resource-file named <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
251-
<p><code>php artisan create:resources AssetCategory --with-soft-delete --with-migration</code></p>
252-
=======
253206
<p><small>The above command will create resource-file names <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
254207
<p><code>php artisan create:scaffold AssetCategory --with-soft-delete --with-migration</code></p>
255-
>>>>>>> v2.3
256208
<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>
257209
</blockquote>
258210

259211
#### Creating resources from existing database
260212

261213
<blockquote>
262-
<<<<<<< HEAD
263-
<p><code>php artisan create:resources AssetCategory --table-exists</code></p>
264-
<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>
265-
266-
<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>
267-
=======
268214
<p><code>php artisan create:scaffold AssetCategory --table-exists</code></p>
269215
<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>
270216

271217
<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>
272-
>>>>>>> v2.3
273218
<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>
274219
</blockquote>
275220

276221

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

279224
<blockquote>
280-
<<<<<<< HEAD
281-
<p><code>php artisan create:resources AssetCategory --translation-for=en,ar --table-exists</code></p>
282-
<p><small>The above command will create resource-file named <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
283-
=======
284225
<p><code>php artisan create:scaffold AssetCategory --translation-for=en,ar --table-exists</code></p>
285226
<p><small>The above command will create resource-file names <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
286-
>>>>>>> v2.3
287227
<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>
288228
<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>
289229
</blockquote>
@@ -292,15 +232,9 @@ The following example assumes that we are trying to create a CRUD called <var>As
292232

293233
<blockquote>
294234
<p><code>php artisan resource-file:from-database AssetCategory --translation-for=en,ar</code></p>
295-
<<<<<<< HEAD
296-
<p><code>php artisan create:resources AssetCategory</code></p>
297-
<p><small>The above command will create resource-file named <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
298-
<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>
299-
=======
300235
<p><code>php artisan create:scaffold AssetCategory</code></p>
301236
<p><small>The above command will create resource-file names <var>/resources/laravel-code-generator/sources/asset_categories.json</var></small></p>
302237
<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>
303-
>>>>>>> v2.3
304238
</blockquote>
305239

306240

composer.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
"name": "crestapps/laravel-code-generator",
33
"license": "MIT",
44
"description": "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.",
5-
<<<<<<< HEAD
6-
"version": "v2.2.14",
7-
=======
85
"version": "v2.4.2",
9-
>>>>>>> v2.3
106
"keywords": [
117
"laravel","crud","crud generator",
128
"laravel crud generator","laravel crud builder",

templates/default-collective/controller-upload-method-5.3.stub

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,9 @@
1212
return '';
1313
}
1414

15-
<<<<<<< HEAD
16-
$path = config('codegenerator.files_upload_path', 'uploads');
17-
$saved = $file->store('public/' . $path, config('filesystems.default'));
18-
19-
return substr($saved, 7);
20-
=======
2115
$fileName = sprintf('%s.%s', uniqid(), $file->getClientOriginalExtension());
2216
$destinationPath = config('laravel-code-generator.files_upload_path','uploads');
2317
$path = $file->move($destinationPath, $fileName);
2418

2519
return $destinationPath . '/' . $fileName;
26-
>>>>>>> v2.3
2720
}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
<<<<<<< HEAD
2-
return \DateTime::createFromFormat('[% date_format %]', $value);
3-
=======
4-
return \DateTime::createFromFormat($this->getDateFormat(), $value)->format('[% date_format %]');
5-
>>>>>>> v2.3
1+
return \DateTime::createFromFormat($this->getDateFormat(), $value)->format('[% date_format %]');
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
<<<<<<< HEAD
2-
$this->attributes['[% field_name %]'] = !empty($value) ? \DateTime::createFromFormat($this->getDateFormat(), $value) : null;
3-
=======
4-
$this->attributes['[% field_name %]'] = !empty($value) ? \DateTime::createFromFormat('[% date_format %]', $value) : null;
5-
>>>>>>> v2.3
1+
$this->attributes['[% field_name %]'] = !empty($value) ? \DateTime::createFromFormat('[% date_format %]', $value) : null;

0 commit comments

Comments
 (0)