Is there a way to run a function (to call an api) once after a module is installed? It could be during admin page load or in the install script. But i wish to run only once. Thanks
1 Answer
Suggest to use Install script because of InstallSchema code is run one time.
So, on your extension, you have to write InstallSchema.php
which is located at app/code/{VendorName}/{ModuleName}/Setup
..
See how to create install scheme Look this block:https://www.magestore.com/magento-2-tutorial/how-to-create-and-upgrade-database-in-magento-2/
-
thanks. But it does not work. I tried to do some action on the install function but it does not do anything.– subhasCommented Aug 28, 2018 at 11:31