Skip to content

Commit

Permalink
Merge pull request #82 from chimit/patch-1
Browse files Browse the repository at this point in the history
Note about making translatable fields searchable
  • Loading branch information
freekmurze authored Aug 24, 2022
2 parents 28f8479 + 018f214 commit 3b863ee
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -80,6 +80,21 @@ public function fields(Request $request)
}
```

### Making translations searchable

Every translation of the translated fields should be added into the `$search` array separately.

```php
/**
* The columns that should be searched.
*
* @var array
*/
public static $search = [
'id', 'name->en', 'name->fr',
];
```

### Customizing the locales per translatable

If you have a Nova resource where you want different locales than the ones configured globally, you can call the `locales` method on `Translatable`.

0 comments on commit 3b863ee

Please sign in to comment.