Open RoseRiyadh opened 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?
use mutateBeforeCreate
mutateBeforeCreate
->mutateBeforeCreate(function ($row) { $row['created_by'] = auth()->id(); return $row; })
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?