platform icon indicating copy to clipboard operation
platform copied to clipboard

Feature/relation search nested fields

Open mvehar-preskok opened this issue 3 years ago • 0 comments

Proposed Changes

Add option to define nested relations/columns when defining searchColumns on Relation field.

Updated code checks if passed columns contain dot, which indicates nested relationship (e.g. Book has user relation, therefore we can now search for Books that have related users with name, email etc.)

 Relation::make('test')->title('Test')
                ->fromModel(Book::class, 'title')
                ->searchColumns('title', 'user.name', 'user.email')

mvehar-preskok avatar Jan 15 '22 23:01 mvehar-preskok