© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
3 replies
Zakhaev

Relation with where id check doesnt work like i want it

I have this piece of code that allows searching all the assets

     Select::make('asset_id')
                        ->label('Selecteer aan middel')
                        ->searchable([
                            'name','identifier'
                        ])
                        ->relationship('asset','full_name')
     Select::make('asset_id')
                        ->label('Selecteer aan middel')
                        ->searchable([
                            'name','identifier'
                        ])
                        ->relationship('asset','full_name')


but now i want them filtered on a organisation_id
this is what i did in the model.

public function asset()
    {
        return $this->belongsTo(Asset::class)->where('organisation_id', Filament::auth()->user()->organisation_id);
    }
public function asset()
    {
        return $this->belongsTo(Asset::class)->where('organisation_id', Filament::auth()->user()->organisation_id);
    }


but when i check it with Telescope i see that the organisation_id check is never performed. Anyone tips for me ?
Solution
i fixed it trough this solution
https://stackoverflow.com/questions/72585431/showing-relational-data-of-a-filament-resource
Stack Overflow
Showing relational data of a Filament resource
I've started using Filament PHP for creating a Laravel based intranet application but stumbled across a question I couldn't answer myself using the official documentation:
What's the easiest way to...
Showing relational data of a Filament resource
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

SelectFilter doesn not work like I want
FilamentFFilament / ❓┊help
13mo ago
->autofocus doesnt work with modals
FilamentFFilament / ❓┊help
3y ago
Uploading doesnt work
FilamentFFilament / ❓┊help
2mo ago
Copyable doesnt work
FilamentFFilament / ❓┊help
3y ago