Global Search

With Lamotivo you may globally search across all your resources using the global search input within the top-navigation bar of the Lamotiov UI:

Searchable Columns

To define which resource fields are searchable, you may assign an array of database columns in the search property of your resource class. This includes id column by default, but you may override it to your needs:

/**
 * The columns that should be searched.
 *
 * @var array
 */
public static $search = [
    'id',
    'title',
    'author',
];

Title Attributes

When a resource is shown within the search results, the results will display the title of the resource. For example, a User resource may use the name attribute as its title. Then, when the resource is shown within the global search results, that attribute will be displayed.

To customize the title attribute of a resource, you may define a title property on the resource class:

public static $title = 'name';

By default, all Lamotivo resources are globally searchable. You may exclude a given resource from the global search by overriding the globallySearchable property on the resource:

public static $globallySearchable = false;