|
30 | 30 | */
|
31 | 31 | 'templates_path' => 'resources/laravel-code-generator/templates',
|
32 | 32 |
|
33 |
| - /* |
34 |
| - |-------------------------------------------------------------------------- |
35 |
| - | Array of templates that should be generated with Laravel-Collective. |
36 |
| - |-------------------------------------------------------------------------- |
37 |
| - | |
38 |
| - | If you want to generate code by using laravel-collective, you must first |
39 |
| - | install the package. Then add the tamplate name that should be using |
40 |
| - | Laravel-Collective extensions when generating code. |
41 |
| - | |
42 |
| - */ |
43 |
| - 'laravel_collective_templates' => [ |
44 |
| - 'default-collective', |
45 |
| - ], |
46 |
| - |
47 | 33 | /*
|
48 | 34 | |--------------------------------------------------------------------------
|
49 | 35 | | The default path of where the uploaded files live.
|
|
59 | 45 |
|
60 | 46 | /*
|
61 | 47 | |--------------------------------------------------------------------------
|
62 |
| - | The default output format for datetime fields. |
| 48 | + | The default output format for DateTime fields. |
63 | 49 | |--------------------------------------------------------------------------
|
64 | 50 | |
|
65 | 51 | | This output format can also be changed at the field level using the
|
|
70 | 56 |
|
71 | 57 | /*
|
72 | 58 | |--------------------------------------------------------------------------
|
73 |
| - | The default path of where the json resource-files are located. |
| 59 | + | The default path of where the JSON resource-files are located. |
74 | 60 | |--------------------------------------------------------------------------
|
75 | 61 | |
|
76 |
| - | In this path, you can create json file to import the resources from. |
| 62 | + | In this path, you can create JSON file to import the resources from. |
77 | 63 | |
|
78 | 64 | */
|
79 | 65 | 'resource_file_path' => 'resources/laravel-code-generator/sources',
|
|
161 | 147 | |--------------------------------------------------------------------------
|
162 | 148 | |
|
163 | 149 | */
|
164 |
| - 'api_docs_controller_path' => 'Http/Controllers/ApiDocs', |
| 150 | + 'api_docs_controller_path' => 'Http/Controllers', |
165 | 151 |
|
166 | 152 | /*
|
167 | 153 | |--------------------------------------------------------------------------
|
|
231 | 217 |
|
232 | 218 | /*
|
233 | 219 | |--------------------------------------------------------------------------
|
234 |
| - | Patterns to use to generate the html placeholders. |
| 220 | + | Patterns to use to generate the HTML placeholders. |
235 | 221 | |--------------------------------------------------------------------------
|
236 | 222 | |
|
237 | 223 | | When creating the fields, the code generator follows a pattern to generate
|
238 |
| - | placeholders for the html code. Here you can define which html-types should |
| 224 | + | placeholders for the HTML code. Here you can define which html-types should |
239 | 225 | | the generator create placeholder for. Also, you can define how would you like
|
240 | 226 | | the text to read when no placeholder is assigned.
|
241 | 227 | |
|
242 |
| - | The follwowing templates can be used to. assuming the field name is owner_name |
| 228 | + | The following templates can be used to. assuming the field name is owner_name |
243 | 229 | | [% field_name %] <=> "owner name"
|
244 | 230 | | [% field_name_sentence %] <=> "Owner name"
|
245 | 231 | | [% field_name_plural %] <=> "owner names"
|
|
268 | 254 | | Key phrases that are will be used to determine if a field should have a relation.
|
269 | 255 | |--------------------------------------------------------------------------
|
270 | 256 | |
|
271 |
| - | When creating resources from existing database, the codegenerator scans |
272 |
| - | the field's name for a mattching pattern. When found, these field are considered |
| 257 | + | When creating resources from existing database, the code generator scans |
| 258 | + | the field's name for a matching pattern. When found, these field are considered |
273 | 259 | | foreign keys even when the database does not have a foreign constraints.
|
274 | 260 | | Here you can specify patterns to help the generator understand your
|
275 |
| - | database naming convension. |
| 261 | + | database naming conversion. |
276 | 262 | |
|
277 | 263 | */
|
278 | 264 | 'common_key_patterns' => [
|
|
338 | 324 | ],
|
339 | 325 | ],
|
340 | 326 | [
|
341 |
| - 'match' => ['picture', 'file', 'photo', 'avatar'], |
| 327 | + 'match' => ['picture', 'photo', 'avatar', 'image'], |
| 328 | + 'set' => [ |
| 329 | + 'is-on-index' => false, |
| 330 | + 'html-type' => 'file', |
| 331 | + 'data-type' => 'string', |
| 332 | + 'data-type-params' => [255], |
| 333 | + 'validation' => 'image', |
| 334 | + ], |
| 335 | + ], |
| 336 | + [ |
| 337 | + 'match' => ['file', 'document', 'attachment*'], |
342 | 338 | 'set' => [
|
343 | 339 | 'is-on-index' => false,
|
344 | 340 | 'html-type' => 'file',
|
| 341 | + 'data-type' => 'string', |
| 342 | + 'data-type-params' => [255], |
| 343 | + 'validation' => 'file', |
345 | 344 | ],
|
346 | 345 | ],
|
347 | 346 | [
|
|
373 | 372 | ],
|
374 | 373 | ],
|
375 | 374 | [
|
376 |
| - 'match' => ['created_at', 'updated_at', 'deleted_at'], |
| 375 | + 'match' => ['created_at', 'updated_at', 'deleted_at', 'modified_at'], |
377 | 376 | 'set' => [
|
378 | 377 | 'data-type' => 'datetime',
|
379 | 378 | 'is-on-form' => false,
|
|
464 | 463 |
|
465 | 464 | /*
|
466 | 465 | |--------------------------------------------------------------------------
|
467 |
| - | A string to postfix the api-resource name with. |
| 466 | + | A string to post fix the api-resource name with. |
468 | 467 | |--------------------------------------------------------------------------
|
469 | 468 | |
|
470 | 469 | | If you don't like to post fix the api-resource with "Resource" you can
|
|
475 | 474 |
|
476 | 475 | /*
|
477 | 476 | |--------------------------------------------------------------------------
|
478 |
| - | A string to postfix the collection-api-resource name with. |
| 477 | + | A string to post fix the collection-api-resource name with. |
479 | 478 | |--------------------------------------------------------------------------
|
480 | 479 | |
|
481 | 480 | | If you don't like to post fix the collection-api-resource with "Collection"
|
|
495 | 494 |
|
496 | 495 | /*
|
497 | 496 | |--------------------------------------------------------------------------
|
498 |
| - | A string to postfix the form-request name with. |
| 497 | + | A string to post fix the form-request name with. |
499 | 498 | |--------------------------------------------------------------------------
|
500 | 499 | |
|
501 | 500 | | If you don't like to post fix the form-request with "FormRequest" you can
|
|
506 | 505 |
|
507 | 506 | /*
|
508 | 507 | |--------------------------------------------------------------------------
|
509 |
| - | Defining non-english or irregular plurals |
| 508 | + | Defining non-English or irregular plurals |
510 | 509 | |--------------------------------------------------------------------------
|
511 | 510 | |
|
512 | 511 | | The code-generator heavily uses Laravel helpers "str_plural()"
|
|
533 | 532 | | The "key" of the array is the value to be used in the locale files.
|
534 | 533 | | The "text" key of the sub array, is the string to display in the view or add to the locale files.
|
535 | 534 | | The "template" key of the sub array, is the string to be use in the view for replacement.
|
536 |
| - | The "in-function-with-collective" key of the sub array, tell the generator that, |
537 | 535 | | this string would be used in a function or not.
|
538 | 536 | |
|
539 |
| - | The follwowing templates can be used. Assuming the model name is AssetCategory |
| 537 | + | The following templates can be used. Assuming the model name is AssetCategory |
540 | 538 | | [% model_name %] <=> "asset category"
|
541 | 539 | | [% model_name_sentence %] <=> "Asset category"
|
542 | 540 | | [% model_name_plural %] <=> "asset categories"
|
|
570 | 568 | 'delete' => [
|
571 | 569 | 'text' => 'Delete [% model_name_title %]',
|
572 | 570 | 'template' => 'delete_model',
|
573 |
| - 'in-function-with-collective' => true, |
574 | 571 | ],
|
575 | 572 | 'edit' => [
|
576 | 573 | 'text' => 'Edit [% model_name_title %]',
|
|
587 | 584 | 'add' => [
|
588 | 585 | 'text' => 'Add',
|
589 | 586 | 'template' => 'add',
|
590 |
| - 'in-function-with-collective' => true, |
591 | 587 | ],
|
592 | 588 | 'update' => [
|
593 | 589 | 'text' => 'Update',
|
594 | 590 | 'template' => 'update',
|
595 |
| - 'in-function-with-collective' => true, |
596 | 591 | ],
|
597 | 592 | 'confirm_delete' => [
|
598 | 593 | 'text' => 'Click Ok to delete [% model_name_title %].',
|
599 | 594 | 'template' => 'confirm_delete',
|
600 |
| - 'in-function-with-collective' => true, |
601 | 595 | ],
|
602 | 596 | 'none_available' => [
|
603 | 597 | 'text' => 'No [% model_name_plural_title %] Available.',
|
|
658 | 652 | 'template' => 'this_parameter_is_an_http_header',
|
659 | 653 | ],
|
660 | 654 | 'request_was_successful' => [
|
661 |
| - 'text' => 'Request was successfull.', |
| 655 | + 'text' => 'Request was successfully.', |
662 | 656 | 'template' => 'request_was_successful',
|
663 | 657 | ],
|
664 | 658 | 'boolean_title' => [
|
|
807 | 801 | | Here you can define labels to be used when creating the api-documentation.
|
808 | 802 | | You can define how would you like the text to be generated.
|
809 | 803 | |
|
810 |
| - | The follwowing templates can be used. Assuming the model name is AssetCategory |
| 804 | + | The following templates can be used. Assuming the model name is AssetCategory |
811 | 805 | | [% model_name %] <=> "asset category"
|
812 | 806 | | [% model_name_sentence %] <=> "Asset category"
|
813 | 807 | | [% model_name_plural %] <=> "asset categories"
|
|
840 | 834 | 'the_total_of_available_pages' => 'The total of the available pages.',
|
841 | 835 | 'store_route_description' => 'Create new [% model_name %].',
|
842 | 836 | 'store_route_response_description' => 'The API\'s response will be JSON based data. The JSON object will be structured as follow',
|
843 |
| - 'update_route_description' => 'Update existsing [% model_name %].', |
| 837 | + 'update_route_description' => 'Update existing [% model_name %].', |
844 | 838 | 'update_route_response_description' => 'The API\'s response will be JSON based data. The JSON object will be structured as follow',
|
845 |
| - 'show_route_description' => 'Retrieve existsing [% model_name %].', |
| 839 | + 'show_route_description' => 'Retrieve existing [% model_name %].', |
846 | 840 | 'show_route_response_description' => 'The API\'s response will be JSON based data. The JSON object will be structured as follow',
|
847 | 841 | 'the_id_of_model_to_retrieve' => 'The unique id of the [% model_name %] to retrieve',
|
848 |
| - 'destroy_route_description' => 'Delete existsing [% model_name %].', |
| 842 | + 'destroy_route_description' => 'Delete existing [% model_name %].', |
849 | 843 | 'destroy_route_response_description' => 'The API\'s response will be JSON based data. The JSON object will be structured as follow',
|
850 | 844 | 'the_id_of_model_to_delete' => 'The id of the [% model_name %] to delete.',
|
851 | 845 | 'general_description' => 'Allows you to list, create, edit, show and delete [% model_name_plural %].',
|
|
929 | 923 | | Eloquent method to html-type mapping.
|
930 | 924 | |--------------------------------------------------------------------------
|
931 | 925 | |
|
932 |
| - | This is the mapping used to convert database-column into html field |
| 926 | + | This is the mapping used to convert database-column into HTML field |
933 | 927 | |
|
934 | 928 | */
|
935 | 929 | 'eloquent_type_to_html_type' => [
|
|
0 commit comments