Struggling filtering a table
Lets say i have this filament table:
the objective is to show the songs with more plays.
eloquent relationships explanation:
tables:
songs: id, name
artists: id, name
artist_song: artist_id, song_id
user_song_play_history: user_id, song_id, is_played
relationships:
Song model:
Artist model:
ArtistSong pivot model:
UserSongPlayHistory pivot model:
at the moment works just fine. the problem is when i try to add a filter to filter by user. i get and so far havent found how to solve it:
the objective is to show the songs with more plays.
eloquent relationships explanation:
tables:
songs: id, name
artists: id, name
artist_song: artist_id, song_id
user_song_play_history: user_id, song_id, is_played
relationships:
Song model:
Artist model:
ArtistSong pivot model:
UserSongPlayHistory pivot model:
at the moment works just fine. the problem is when i try to add a filter to filter by user. i get and so far havent found how to solve it:
Expected type 'Illuminate\Database\Eloquent\Builder'. Found 'Closure(mixed, mixed): void'