Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

angerfist's avatar

Method Filament\Forms\Components\FileUpload::table does not exist.

hi i need help Method Filament\Forms\Components\FileUpload::table does not exist. I can't understand what is my mistake, I need help guys, help me out outdoctorresource.php

        return $form
            ->schema([
                Card::make()->schema([
                    TextInput::make('title')
                        ->label('заголовок')
                        ->reactive()
                        ->afterStateUpdated(function (Closure $set, $state) {
                            $set('slug', Str::slug($state));
                        })->required(),
                    TextInput::make('desk')->label('специальность'),
                    FileUpload::make('image')->image()->label('прикрепить файл'),
                    FileUpload::make('attachment')->minSize(10)->label('минимальный размер 10Кб'),
                    FileUpload::make('attachment')->minSize(4096)->label('максимальный размер 4096Кб'),
                    TinyEditor::make('content')->required()->label('содержание'),
                    Toggle::make('is_published')->label('видимость')
                ])
            ]);
    }

    public static function table(Table $table): Table
    {
        return $table
            ->columns([
                TextColumn::make('id')->sortable()->searchable()->label('номер'),
                TextColumn::make('title')->limit(20)->label('заголовок')->sortable()->searchable(),
                TextColumn::make('desk')->limit(50)->label('описание')->sortable()->searchable(),
                FileUpload::make('attachment')->label('файл')->preserveFilenames(),
                BooleanColumn::make('is_published')->searchable()->label('видимость'),
            ])

my model

class OurDoctor extends Model
{
    protected $fillable =
        [
           'desk',
           'attachment',
           'content',
           'is_published',
        ];
}

my migration

    public function up()
    {
        Schema::create('our_doctors', function (Blueprint $table) {
            $table->id();
            $table->string('title');
            $table->string('desk')->nullable();
            $table->text('content');
            $table->text('image')->nullable();
            $table->text('attachment');
            $table->boolean('is_published')->default(false);
            $table->timestamps();
        });
    }

php artisan migration:fresh run but still error

0 likes
2 replies
click's avatar

The exception shows you exactly which file and which line your error Method Filament\Forms\Components\FileUpload::table does not exist. shows. Which file and which line is that?

1 like
devdem's avatar

I am getting the same error Method Yemenpoint\FilamentTree\Forms\Components\TreeField::table does not exist. how to resolve this public static function table(Table $table): Table { return $table ->columns([ TreeField::make("items") ->setMaxDepth(999) ->default([["id" => "1", "name" => "item 1", "children" => [["id" => "2", "name" => "item 2", "children" => []]]]]), ])

Please or to participate in this conversation.