/** * Overwrite the parent boot method * * @return void */ public static function boot() { parent::boot(); MaterialCostLog::creating(function ($materialCostLog) { $materialCostLog->mat_cost_added_user_id_fk = \Auth::user()->id; $materialCostLog->mat_cost_modified_user_id_fk = \Auth::user()->id; }); MaterialCostLog::updating(function ($materialCostLog) { $materialCostLog->mat_cost_modified_user_id_fk = \Auth::user()->id; }); }