Use resource record ID in file upload path

I need to use the record id in my file path when uploading files. Is this possible, and if so, how would I go about doing that?

This is my form:
Section::make()
                    ->description('Attach any files related to this policy')
                    ->heading('Claim attachments')
                    ->schema([
                        FileUpload::make('attachments')
                            ->label('')
                            ->multiple()
                            ->disk('public')
                            ->directory('claim-attachments')
                            ->preserveFilenames()
                            ->downloadable()
                            ->enableOpen()
                            ->previewable(false)
                    ]),


I would like to use something like, ->directory('claim-attachments' . $this->id)
Was this page helpful?