1 | <?php |
||
12 | class Field extends Fluent |
||
13 | { |
||
14 | /** |
||
15 | * Field type. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $type = 'text'; |
||
20 | |||
21 | /** |
||
22 | * Password constructor. |
||
23 | */ |
||
24 | public function __construct($attributes = []) |
||
30 | |||
31 | /** |
||
32 | * Make a new instance of a field. |
||
33 | * |
||
34 | * @param string $name |
||
35 | * @param string $label |
||
36 | * @return Field |
||
37 | */ |
||
38 | public static function make($name, $label = '') |
||
51 | |||
52 | /** |
||
53 | * @param string $label |
||
54 | * @return $this |
||
55 | * @see https://editor.datatables.net/reference/option/fields.label |
||
56 | */ |
||
57 | public function label($label) |
||
63 | |||
64 | /** |
||
65 | * @param string $name |
||
66 | * @return $this |
||
67 | * @see https://editor.datatables.net/reference/option/fields.name |
||
68 | */ |
||
69 | public function name($name) |
||
75 | |||
76 | /** |
||
77 | * @param string $data |
||
78 | * @return $this |
||
79 | * @see https://editor.datatables.net/reference/option/fields.data |
||
80 | */ |
||
81 | public function data($data) |
||
87 | |||
88 | /** |
||
89 | * @param string $type |
||
90 | * @return $this |
||
91 | * @see https://editor.datatables.net/reference/option/fields.type |
||
92 | */ |
||
93 | public function type($type) |
||
99 | |||
100 | /** |
||
101 | * Get options from a model. |
||
102 | * |
||
103 | * @param mixed $model |
||
104 | * @param string $value |
||
105 | * @param string $key |
||
106 | * @return Field |
||
107 | */ |
||
108 | public function modelOptions($model, $value, $key = 'id') |
||
114 | |||
115 | /** |
||
116 | * Set select options. |
||
117 | * |
||
118 | * @param array|mixed $options |
||
119 | * @return $this |
||
120 | */ |
||
121 | public function options($options) |
||
131 | |||
132 | /** |
||
133 | * Get options from a table. |
||
134 | * |
||
135 | * @param mixed $table |
||
136 | * @param string $value |
||
137 | * @param string $key |
||
138 | * @param \Closure $whereCallback |
||
139 | * @param string|null $key |
||
140 | * @return Field |
||
141 | */ |
||
142 | public function tableOptions($table, $value, $key = 'id', \Closure $whereCallback = null, $connection = null) |
||
148 | |||
149 | /** |
||
150 | * Set checkbox separator. |
||
151 | * |
||
152 | * @param string $separator |
||
153 | * @return $this |
||
154 | */ |
||
155 | public function separator($separator = ',') |
||
161 | |||
162 | /** |
||
163 | * Set dateTime format. |
||
164 | * |
||
165 | * @param string $format |
||
166 | * @return $this |
||
167 | * @see https://editor.datatables.net/reference/field/datetime |
||
168 | */ |
||
169 | public function format($format) |
||
175 | |||
176 | /** |
||
177 | * Set field default value. |
||
178 | * |
||
179 | * @param mixed $value |
||
180 | * @return $this |
||
181 | * @see https://editor.datatables.net/reference/option/fields.def |
||
182 | */ |
||
183 | public function default($value) |
||
189 | |||
190 | /** |
||
191 | * Set field message value. |
||
192 | * |
||
193 | * @param string $value |
||
194 | * @return $this |
||
195 | * @see https://editor.datatables.net/reference/option/fields.message |
||
196 | */ |
||
197 | public function message($value) |
||
203 | |||
204 | /** |
||
205 | * Set field fieldInfo value. |
||
206 | * |
||
207 | * @param string $value |
||
208 | * @return $this |
||
209 | * @see https://editor.datatables.net/reference/option/fields.fieldInfo |
||
210 | */ |
||
211 | public function fieldInfo($value) |
||
217 | |||
218 | /** |
||
219 | * Set field labelInfo value. |
||
220 | * |
||
221 | * @param string $value |
||
222 | * @return $this |
||
223 | * @see https://editor.datatables.net/reference/option/fields.labelInfo |
||
224 | */ |
||
225 | public function labelInfo($value) |
||
231 | |||
232 | /** |
||
233 | * Set field entityDecode value. |
||
234 | * |
||
235 | * @param mixed|bool $value |
||
236 | * @return $this |
||
237 | * @see https://editor.datatables.net/reference/option/fields.entityDecode |
||
238 | */ |
||
239 | public function entityDecode($value) |
||
245 | |||
246 | /** |
||
247 | * Set field multiEditable value. |
||
248 | * |
||
249 | * @param mixed|bool $value |
||
250 | * @return $this |
||
251 | * @see https://editor.datatables.net/reference/option/fields.multiEditable |
||
252 | */ |
||
253 | public function multiEditable($value) |
||
259 | |||
260 | /** |
||
261 | * Set field id value. |
||
262 | * |
||
263 | * @param string $value |
||
264 | * @return $this |
||
265 | * @see https://editor.datatables.net/reference/option/fields.id |
||
266 | */ |
||
267 | public function id($value) |
||
273 | |||
274 | /** |
||
275 | * Set field submit value. |
||
276 | * |
||
277 | * @param bool $value |
||
278 | * @return $this |
||
279 | * @see https://editor.datatables.net/reference/option/fields.submit |
||
280 | */ |
||
281 | public function submit($value) |
||
287 | |||
288 | /** |
||
289 | * Set field compare value. |
||
290 | * |
||
291 | * @param bool $value |
||
292 | * @return $this |
||
293 | * @see https://editor.datatables.net/reference/option/fields.compare |
||
294 | */ |
||
295 | public function compare($value) |
||
301 | } |
||
302 |