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
This package uses a config file which you can override by publishing it to your app's config dir.
@@ -67,16 +59,16 @@ class PostController extends Controller
67
59
}
68
60
```
69
61
70
-
In the controller's constructor we define the properties which are handled by the controller.
71
-
The available properties we can define are as follows.
62
+
In the controller's constructor you can define the properties which are handled by the controller.
63
+
The available properties that can be defined are as follows.
72
64
73
65
### The model
74
66
75
67
This is the model, which should be passed in the constructor through Dependency Injection.
76
68
77
69
### The formFields array
78
70
79
-
This is an array of all the fields you need in the forms. Each field is an array that has:
71
+
This is an array of all the fields you need in the forms. Each field is declared as an array that has:
80
72
1.`name`: This is the model's attribute name, as it is in the database.
81
73
2.`label`: This is the field's label in the forms.
82
74
3.`type`: The type of the form input field that will be used. Accepted types are:
@@ -93,7 +85,7 @@ This is an array of all the fields you need in the forms. Each field is an array
93
85
- radio
94
86
4.`relationship`: This is needed in case of a select, select_multiple, radio or checkbox_multiple buttons.
95
87
You can state here the name of the relationship as it is defined in the model.
96
-
In the example above, the `Post` model has a `belongsTo` relationship to `category` and a `belongsToMany` relationship to `tags`.
88
+
In the example bellow, the `Post` model has a `belongsTo` relationship to `category` and a `belongsToMany` relationship to `tags`.
97
89
For `belongsTo` relationships you can use a select or a radio(group of radios) input.
98
90
For `belongsToMany` relationships you can use a select_multiple or checkbox_multiple inputs.
99
91
5.`relFieldName`: This is optional. It is used only in case we have a relationship, to set the name of the attribute of the related model that is displayed (ie. in a select's options).
@@ -123,7 +115,8 @@ If not defined, then the first of the `formFields` is shown.
123
115
124
116
### The `formTitle` (optional)
125
117
126
-
You can optionally, define the name of the model as we want it to appear in the views. If not defined, the name of the model will be used.
118
+
You can optionally, define the name of the model as we want it to appear in the views.
119
+
If not defined, the name of the model will be used.
127
120
128
121
### The `bladeLayout` (optional)
129
122
@@ -149,12 +142,12 @@ These are the rules we want to use to validate data before saving the model.
149
142
150
143
```php
151
144
$this->validationRules = [
152
-
'title' => 'string|required|max:255',
153
-
'slug' => 'string|required|max:100',
145
+
'title' => 'required|max:255',
146
+
'slug' => 'required|max:100',
154
147
'body' => 'required',
155
148
'publish_on' => 'date',
156
149
'published' => 'boolean',
157
-
'category_id' => 'int|required',
150
+
'category_id' => 'required|int',
158
151
];
159
152
```
160
153
@@ -185,7 +178,8 @@ The views are built with bootstrap v.3 and also have css classes to support some
185
178
- datepicker class is used in date inputs
186
179
- data-table class is used in the index view table
187
180
188
-
It is also possible to publish the views, so you can change them anyway you need. To publish them, use the following artisan command:
181
+
It is also possible to publish the views, so you can change them anyway you need.
182
+
To publish them, use the following artisan command:
0 commit comments