You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/resource-file.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,10 +31,10 @@ The argument `[model-name]` should be replaced with the name of the model you ar
31
31
32
32
| Option | Description |
33
33
| ----------- | ----------- |
34
-
| <aname="resource-filename">--resource-filename</a>| The name of the file to be created. When this option is left out, the file will be the plural-form of the model name. If the model name is `AssetCategory`, the file name will be `asset_categories.json`. |
35
-
| <aname="fields">--fields</a> | A list of the field names to be created. The names should be separated by a comma. <br /><br /> You may also pass a complex string using the following schema <br /><br /> `--fields="name:colors;html-type:select;options:blue\|yellow\|green\|red\|white,name:second_field_name"` <br /><br /> Complex string are allowed and will be handy is some cases. However, in most cases all you need to pass is the field names as the common_definitions key in the configuration file will define most options for you out of the box using the name of the field.<br /><br /> Each field in the complex string must be seperated by a `,`. Also each property in the field must be seperated by `;` while each option of a property is seperated by `\|`. |
36
-
| <aname="relations">--relations</a> | A list of the relations to be created. The string should follow the schema below <br /><br /> `--relations="name:comments;type:hasMany;field:title;params:App\Models\Comment\|post_id\|id"` <br /><br /> Each relation in the string must be seperated by a `,`. Also each property in the relation must be seperated by `;` while each parameter of the params property seperated by `\|`. |
37
-
| <aname="indexes">--indexes</a> | A list of the indexes to be created. The string should follow the schema below<br /><br /> `--indexes="name:first_last_name_index;columns:first_name\|last_name"`. <br /><br /> Each index in the string must be seperated by a `,`. Also each property in the index must be seperated by `;` while each field name in the columns property seperated `\|`.|
34
+
| <aname="resource-filename"></a>--resource-filename | The name of the file to be created. When this option is left out, the file will be the plural-form of the model name. If the model name is `AssetCategory`, the file name will be `asset_categories.json`. |
35
+
| <aname="fields"></a>--fields| A list of the field names to be created. The names should be separated by a comma. <br /><br /> You may also pass a complex string using the following schema <br /><br /> `--fields="name:colors;html-type:select;options:blue\|yellow\|green\|red\|white,name:second_field_name"` <br /><br /> Complex string are allowed and will be handy is some cases. However, in most cases all you need to pass is the field names as the common_definitions key in the configuration file will define most options for you out of the box using the name of the field.<br /><br /> Each field in the complex string must be seperated by a `,`. Also each property in the field must be seperated by `;` while each option of a property is seperated by `\|`. |
36
+
| <aname="relations"></a>--relations| A list of the relations to be created. The string should follow the schema below <br /><br /> `--relations="name:comments;type:hasMany;field:title;params:App\Models\Comment\|post_id\|id"` <br /><br /> Each relation in the string must be seperated by a `,`. Also each property in the relation must be seperated by `;` while each parameter of the params property seperated by `\|`. |
37
+
| <aname="indexes"></a>--indexes| A list of the indexes to be created. The string should follow the schema below<br /><br /> `--indexes="name:first_last_name_index;columns:first_name\|last_name"`. <br /><br /> Each index in the string must be seperated by a `,`. Also each property in the index must be seperated by `;` while each field name in the columns property seperated `\|`.|
| --force | This option will override any file that already exist. |
40
40
:::
@@ -152,7 +152,7 @@ The argument `[model-name]` should be replaced with the name of the model you ar
152
152
| validation | You can pass any valid Laravel validation rule. The rules should be separated by bar `\|`. <br /><br /> For example: `required\|string\|min:2\|max:255` <br /><br />Start with Laravel 5.5, you can define custom validation rules and pass them as well. For example, to use a custom validation rule called Uppercase in addition to the required rule, you can pass this string required|new Uppercase.<br /><br /> To learn more about the valid options please visit [Laravel documentation](https://laravel.com/docs/master/validation#available-validation-rules). <br /><br /> When the rule `required` is not used, the field in the migration file will automatically become nullable. |
153
153
| html-type | Default value: `text`. A valid property will be one of the following options <br /> `text`, `textarea`, `password`,`email`,`checkbox`,`radio`,`number`,`select`,`hidden`,`file`,`selectRange`,`selectMonth`, or `multipleSelect`. <br /><br />Note: when using file type, after the file is uploaded to the designated path, the filename is stored in the database by default. For everything to work properly, the data-type must be of some sort of a string type. Or modify the behavior of moveFile method to handle the new file.<br /><br /> By default this process stores the uploaded file in the path defined in config file. <br /><br />Note: when using checkbox, or multipleSelect, the items are stored in the database as JSON string. Additionally, the items in the index or form views are displayed separated by the value provided in the delimiter property. |
154
154
| delimiter | Default value: "; ". When generating a form with checkbox or a select menu that accepts multiple answers, we need either store the results in a foreign model or store the records in a string field. By default, the code generator will convert the multiple options that a user selected into a JSON string before the results are stored using a Eloquent-mutator method. <br /><br />When the data is presented on the show and/or index views, the options are displayed separated by the value of the delimiter. Of course, you can always change this behavior to fit your needs by removing the accessor and mutator methods in the model and modifying the views accordingly. |
155
-
| css-class | You can add custom css class(es) to the html input. Any value is placed in this option will be appended to the field's `class="..."`` property. Classes that are already set in the views will not be replaced. |
155
+
| css-class | You can add custom css class(es) to the html input. Any value is placed in this option will be appended to the field's `class="..."` property. Classes that are already set in the views will not be replaced. |
156
156
| date-format | Default value: "m/d/Y H:i A". Any field with the type date, time or datetime can be formatted different when it is displayed. You can change the display format using this option. |
157
157
| html-value | A default value to set the field to. When using multiple options based html-type like checkbox, multipleSelect you can set this property to array of values to set multiple values by default. Ex, `["Red","Green"]`|
158
158
| options | If you used select, checkbox, or radio for the html-type property, this is where you provide the options. Here are some example of the schema. <br /> <br /> A simple array: In this option, the value will be the numeric index value of the item in the array. <br /> ```"options": ["Prefer not to say","Male","Female"]```.<br /> Using explicit values <br /> ```"options": { "": Prefer not to say", "male": "Male","female": "Female"}```. <br /> Using multiple language phrases for each option <br /> ```"options": {"en":{"":"Prefer not to say","male":"Male","female":"Female"},"ar":{"":"Prefer not to say in Arabic","male":"Male in Arabic","female":"Female in Arabic"},"fr":{"":"Prefer not to say in French","male":"Male in French","female":"Female in French"}}```|
@@ -161,8 +161,8 @@ The argument `[model-name]` should be replaced with the name of the model you ar
161
161
| is-on-index | Default value: `true`. Setting the value to `false` will prevent from adding this field to the index view. |
162
162
| is-on-form | Default value: `true`. Setting the value to `false` will prevent from adding this field to the form view. |
163
163
| is-on-show | Default value: `true`. Setting the value to `false` will prevent from adding this field to the show view. |
164
-
| is-on-views | Default value: `true`. Setting the value to `false`` will prevent from adding this field to the index, form or show view. This is just a short way to change the visibility for all views. |
165
-
| is-header | Default value: false. Only one field can be set to a header. The header field will be use as the page header in the show view. The key `common_header_patterns`` in the configuration file, allow you to list the common field name to automatically set them as header. |
164
+
| is-on-views | Default value: `true`. Setting the value to `false` will prevent from adding this field to the index, form or show view. This is just a short way to change the visibility for all views. |
165
+
| is-header | Default value: false. Only one field can be set to a header. The header field will be use as the page header in the show view. The key `common_header_patterns` in the configuration file, allow you to list the common field name to automatically set them as header. |
0 commit comments