Related page with unconventional relation to parent
Hi, I'm trying to setup a related page with an unconventional relation to parent.
Contact hasMany Bookmarks
Bookmarks belongsTo Buyer (Contact)
App\Models\Contact.php
App\Models\Bookmark.php
I've setup the inverseRelationship on the table call in the related page :
ManageContactBookmarks.php
Bug when i try to open the relationship page i got this 500 error :
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'bookmarks.contact_id' in 'WHERE' (Connection: mariadb, SQL: select count(*) as aggregate from
bookmarks where
bookmarks.
contact_id = 01996b34-3e88-723a-91c9-36cbd93c6090 and
bookmarks.
contact_id is not null and (
bookmarks.
deleted_at is null) and
bookmarks.
tenant_id in (01996b34-3d92-72ef-93b0-66e5d7546836))
Seems like it doesn't take into account my relationship to a specific column that doesn't follow convention.1 Reply
Ok found it ! Nothing related to Filament. I assumed I needed to specify the specific foreign key, on the belongsTo relationship but it was on the hasMany relationship also.