Filter/scope table data based on a PHP function, not using QueryBuilder based on values in database

Is it possible to filter/scope data in a table, based on some computed values that are not stored in the database? Hypothetical example: A list of users, but only show users that passes a filter function.

I can only find filter/scope examples what uses the Query Builder, not anything based on some PHP code running after the query builder but before adding it to the table.
Was this page helpful?