From 14e6779b8853521ff1f6a8df7823763c4b8931c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20R=C3=BCckert?= Date: Tue, 21 Jan 2020 18:04:01 +0100 Subject: [PATCH] [refs #1] Add new name feature to README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e4fb7e5..a317a3d 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,16 @@ This package assumes you have a text-search setup for your Eloquent models. See For this example let's assume a user belongs to a department and a department has many users. To make the relationship searchable via a filter, add this to the `filters()` function of your Nova user resource: +By default the filter will display the name of the `fieldAttribute` you passed on instantiation. You can customize the name by passing it as an argument to the filter's construct function, for example `my-new-name`. + ```php // app/Nova/User.php public function filters(Request $request) { return [ - (new NovaSearchableBelongsToFilter) + (new NovaSearchableBelongsToFilter('my-new-name')) ->fieldAttribute('department') ->filterBy('department_id') ]; } -``` +``` \ No newline at end of file