The accessor relies on the query having already run; the data fetched and the model hydrated. You are attempting to use a PHP-land accessor in a SQL query.
You can do this, but it is not very efficient because you need to create an Artist instance for every record (even though that instance has only the needed columns:
The get() is the end of the Query Builder part; thereafter you are in EloquentCollection land. Although many methods share the same name, you are working with different objects across that expression depending on what each method returns.
If @michaloravec answer helped you more, please consider marking it Best Reply