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
We have included a simple way to address some issues regarding third party packages occasionally not working with Nova Inline Relationships. These packages occasionally handle how they return their subset of fields slightly different. We have a way of easily integrating functionality for these packages. This may not work across the board, but should allow for most third party packages.
80
+
81
+
You must publish the configs for this package with
82
+
83
+
```shell script
84
+
php artisan vendor:publish
85
+
```
86
+
87
+
This will publish a config file as `config/nova-inline-relationships.php`. Add your custom namespaced paths within the `third-party` array. For example:
Create a new class inside that namespace that looks like the following:
97
+
98
+
```php
99
+
<?php
100
+
101
+
namespace App\Nova\ThirdPartyIntegrations;
102
+
103
+
use KirschbaumDevelopment\NovaInlineRelationship\Integrations\ThirdParty;
104
+
use KirschbaumDevelopment\NovaInlineRelationship\Integrations\Contracts\ThirdPartyContract;
105
+
106
+
class SomeThirdPartyField extends ThirdParty implements ThirdPartyContract
107
+
{
108
+
/**
109
+
* Fields array from object.
110
+
*
111
+
* @return array
112
+
*/
113
+
public function fields(): array
114
+
{
115
+
// The following is just an example and should be updated to meet your needs.
116
+
return $this->field->customFieldArray;
117
+
}
118
+
}
119
+
```
120
+
121
+
The name of the class is very important. It should be the same name as the field used within the Nova resource. If the field class is `CustomField`, the third party integration class should also be called `CustomField`.
122
+
123
+
The `fields()` method should return an array of all the custom field's or package's fields array.
124
+
125
+
If you feel that the third party integration you've created should be included in this package, please create a pull request and we will look over it!
126
+
77
127
## Supported Relationships
78
128
79
129
The following eloquent relationships are currently supported:
0 commit comments