Basic question regarding relationships in a resource

I have a Post resource, that has a user_id column, and in my form method I have this array:

public static function form(Form $form): Form
    {
        return $form
            ->schema([
                Forms\Components\TextInput::make('title')
                    ->required()
                    ->maxLength(255),
                Forms\Components\Textarea::make('content')
                    ->required()
                    ->minLength(5),

            ]);
    }

How can I automatically save the current authenticated user in the user_id? I have searched the documentation and tried it on the CreatePost class with the mutateFormDataBeforeCreate method but sill doesn't work.
Was this page helpful?