© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago
Wim

Filament resource for Markable

I'm using this package. It works well however I would like to show the favorites in Filament backend. I have a model
Product
Product
. A user can mark a Product as favorite, which results in entries in the table
favorites
favorites
as follows:

id     |    user_id      |    markable_type          |      markable_id
 1     |        1        |    App\Models\Product     |            5
 2     |        1        |    App\Models\Product     |            6
id     |    user_id      |    markable_type          |      markable_id
 1     |        1        |    App\Models\Product     |            5
 2     |        1        |    App\Models\Product     |            6

I have the following model:

class Product extends Model
{
    use HasFactory, Multitenantable, Markable;

  public function favorites(): belongsToMany
    {
        return $this->belongsToMany(Markable::class);
    }
}
class Product extends Model
{
    use HasFactory, Multitenantable, Markable;

  public function favorites(): belongsToMany
    {
        return $this->belongsToMany(Markable::class);
    }
}

Ideally I have a resource called
FavoriteResource
FavoriteResource
which allows me to show all favorite products for that user.

Any idea how this can be done, given I did not create the model
Favorites
Favorites
(but rather using the markable package).
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Filament Resource Error
FilamentFFilament / ❓┊help
2y ago
Route not found for Filament Resource Page
FilamentFFilament / ❓┊help
10mo ago
Set table to use for filament resource
FilamentFFilament / ❓┊help
16mo ago
Filament Resource Generation Error
FilamentFFilament / ❓┊help
4d ago