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: README.md
+23-30Lines changed: 23 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# Nova Inline Relationship
2
2
3
3
## Introduction
4
-
Nova Inline Relationship is meant to present a relationship based property as an inline property for a Laravel Nova Resource. This project is under active development, and currently only supports singular relationships. You are welcome to request or contribute by opening an issue.
4
+
Nova Inline Relationship is meant to present a relationship based property as an inline property for a Laravel Nova Resource. You are welcome to request or contribute by opening an issue.
After installation, your model should include the `KirschbaumDevelopment\NovaInlineRelationship\Traits\HasRelatedAttributes` trait and you must implement the `KirschbaumDevelopment\NovaInlineRelationship\Contracts\MappableRelationships` Contract.
23
23
24
24
You must also define a static `getPropertyMap` function in the model which should return the required list of properties from your related models you want to show inline.
25
-
In this example `Employee` model has two related models `EmployeProfile` and `EmployeeBill`
25
+
In this example `Employee` model has two related models `EmployeeProfile` and `EmployeeBill`
26
26
27
27
```php
28
28
use KirschbaumDevelopment\NovaInlineRelationship\Traits\HasRelatedAttributes;
@@ -236,29 +236,6 @@ You can pass on following items for your related model's attributes:-
236
236
5.`placeholder`: A placeholder for your field.
237
237
6.`options`: Additional options for your components
238
238
239
-
### Select Component
240
-
To pass dropdown options to your select component, pass an array of key values to options
241
-
```php
242
-
'component => Select::class,
243
-
'options' => [
244
-
'options' => [
245
-
['label' => 'Yes', 'value' => true],
246
-
['label' => 'No', 'value' => false],
247
-
],
248
-
]
249
-
```
250
-
251
-
### Number/Currency Component
252
-
You can pass `min`, `max` and `step` to number and currency field
253
-
```php
254
-
'component' => Currency::class,
255
-
'options' => [
256
-
'min' => 0,
257
-
'max' => 100,
258
-
'step' => 10,
259
-
],
260
-
```
261
-
262
239
## Supported fields
263
240
264
241
You can use any field you can add to your Nova resource with `Field::make` syntax. The following native Nova 2.0 fields are confirmed to work.
@@ -282,12 +259,28 @@ You can use any field you can add to your Nova resource with `Field::make` synta
282
259
- Image Field
283
260
- File Field
284
261
285
-
**_NOTE:_** You can pass any additional arguments (like options for your select field) with your settings map using `options`.
286
-
287
-
## Things to Fix
262
+
### Select Component
263
+
To pass dropdown options to your select component, pass an array of key values to options
264
+
```php
265
+
'component => Select::class,
266
+
'options' => [
267
+
'options' => [
268
+
['label' => 'Yes', 'value' => true],
269
+
['label' => 'No', 'value' => false],
270
+
],
271
+
]
272
+
```
288
273
289
-
1.~~Currently for all three file field (File, Image and Avatar) File deletion is not working.~~
290
-
2.~~relationship names with underscore might cause some issues returning values correctly.~~
274
+
### Number/Currency Component
275
+
You can pass `min`, `max` and `step` to number and currency field
0 commit comments