Skip to content

Filament import action #14761

Answered by leandrocfe
w0r00d asked this question in Help
Nov 11, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

You can do something like this:

public static function getOptionsFormComponents(): array
{
    return [
        Select::make('custom')
        ->options([...]),
    ];
}

public function resolveRecord(): ?YourModel
{
    return YourModel::firstOrNew(
        [
            'field1' => $this->data['field1'],
            'field2' => $this->data['field2'],
            'your_custom_column' => $this->options['custom'],
        ]);

    return new YourModel;
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@w0r00d
Comment options

@leandrocfe
Comment options

Answer selected by w0r00d
@w0r00d
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants