Skip to content
Discussion options

You must be logged in to vote

You could use mutateData to retrieve the model.

public static function mutateData(array $data): array
{
    $pageContent = PageContent::find($data['page_content_id'] ?? null);
    return [...$data, 'page_content' => $pageContent];
}

docs: https://filamentphp.com/plugins/fabricator#mutate-data

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sergeynilov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants