konnco / filament-import

why import must use a template when you can import all files dynamically?
MIT License
206 stars 62 forks source link

handleRecordCreation is not working #149

Open RoseRiyadh opened 10 months ago

RoseRiyadh commented 10 months ago

how do i work with this function that is added in the documentation? do you have an alternative function?

my case is that i want to save ['created_by'] = Auth::id() with each row saved how do i do that?

michabbb commented 8 months ago

use mutateBeforeCreate

->mutateBeforeCreate(function ($row) {
                            $row['created_by'] = auth()->id();
                            return $row;
                        })