How to get Importers Email Address on afterImport Event #2999
-
Hello Everyone! I wanted to send a summary of an Excel/CSV file uploading and processing. I am using the ShouldQueue thread to validate and update each raw in the background and I passed the importer's user object to the Importer object via constructor but the importers object value will get lost on the afterImport event. I even declared a static variable and set its value to the passed user object but in the afterImport event it keeps giving me null. Here is my code:
and if I run queue:work every time it keeps on giving me an error accessing a property of a null object. Thanks for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You have to get/set it via the |
Beta Was this translation helpful? Give feedback.
You have to get/set it via the
$event->getConcernable()
which is the actual instance of your import.self::
doesn't refer to the import in events.