© 2026 Hedgehog Software, LLC

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

Show hidden model attributes

What I am trying to do:
I am trying to show hidden model attributes in form.

What I did:
Searched whole documentation and searched here in questions, but still can't solve it.

My issue/the error:
Hidden attributes is not accessible trough form. Is there any way make it visible like in Laravel when using
$model->makeVisible(['provider_id', 'provider'])
$model->makeVisible(['provider_id', 'provider'])
?

Code:

// Model
protected $hidden = ['provider', 'provider_id', 'content_id'];
protected $hidden = ['provider', 'provider_id', 'content_id'];


// Filament form
    public static function form(Form $form): Form
    {
        return $form
            ->schema([
                TextInput::make("title"),
                TextInput::make("poster_image"),
                TextInput::make("type"),
                TextInput::make("provider"),
                TextInput::make("provider_id"),
            ]);
    }
    public static function form(Form $form): Form
    {
        return $form
            ->schema([
                TextInput::make("title"),
                TextInput::make("poster_image"),
                TextInput::make("type"),
                TextInput::make("provider"),
                TextInput::make("provider_id"),
            ]);
    }
Solution
Try this:
TextInput::make('provider')
 ->visibleOn('view')
 ->formatStateUsing(fn (Model $item) => $item->provider),
TextInput::make('provider')
 ->visibleOn('view')
 ->formatStateUsing(fn (Model $item) => $item->provider),


Of course, you need to replace the Model with your specified model. 🙂
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

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Custom model attributes in model
FilamentFFilament / ❓┊help
2y ago
Show latitude and longitude in Hidden
FilamentFFilament / ❓┊help
2y ago
show hidden fields conditionaly not working
FilamentFFilament / ❓┊help
3y ago