Importer: beforesave() hook check

good day, i want to make the following code possible
 protected function beforeSave(): void
    {
        // passing with the data a field that is for created by user
        $this->data['created_by'] = Auth::id();
    }

is it correct? because i tried it and it didn't work. how do i make it better?
Was this page helpful?