Skip to content

Commit

Permalink
Resource is also searchable if $searchRelations is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
TitasGailius committed Sep 1, 2018
1 parent 4e4f508 commit de329d7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/SearchesRelations.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@

trait SearchesRelations
{
/**
* Determine if this resource is searchable.
*
* @return bool
*/
public static function searchable()
{
return parent::searchable() || ! empty(static::$searchRelations);
}

/**
* Apply the search query to the query.
*
Expand Down

0 comments on commit de329d7

Please sign in to comment.