© 2026 Hedgehog Software, LLC

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

how to add field to a view page?

I added a view page to a resource already existing
php artisan make:filament-page ViewPlaylist --resource=PlaylistResource --type=ViewRecord
php artisan make:filament-page ViewPlaylist --resource=PlaylistResource --type=ViewRecord


I registered the page in
PlaylistResource::getPages()
PlaylistResource::getPages()


    public static function getPages(): array
    {
        return [
            'index' => Pages\ListPlaylists::route('/'),
            'view' => Pages\ViewPlaylist::route('/{record}'),
            'create' => Pages\CreatePlaylist::route('/create'),
            'edit' => Pages\EditPlaylist::route('/{record}/edit'),
        ];
    }
    public static function getPages(): array
    {
        return [
            'index' => Pages\ListPlaylists::route('/'),
            'view' => Pages\ViewPlaylist::route('/{record}'),
            'create' => Pages\CreatePlaylist::route('/create'),
            'edit' => Pages\EditPlaylist::route('/{record}/edit'),
        ];
    }


it created succesfully
app/Filament/Resources/PlaylistResource/Pages/ViewPlaylist.php
app/Filament/Resources/PlaylistResource/Pages/ViewPlaylist.php


My question is: how and where must I add all the readonly fields I need?
Solution
Found!

because I don't want to edit, I didn't add inputs to form .

I added and all is working

    public static function form(Form $form): Form
    {
        return $form
            ->schema([
                TextInput::make('name')->label('nome'),
                TextInput::make('description')->label('descrizione'),
            ]);
    }
    public static function form(Form $form): Form
    {
        return $form
            ->schema([
                TextInput::make('name')->label('nome'),
                TextInput::make('description')->label('descrizione'),
            ]);
    }
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

How to add class to view page?
FilamentFFilament / ❓┊help
2y ago
Add view to table page
FilamentFFilament / ❓┊help
2y ago
How to change a label for a field, in view page?
FilamentFFilament / ❓┊help
2y ago