platform
platform copied to clipboard
Feature/relation search nested fields
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')