I would like to use modules for my project, It is good,
But I would like to do some Enable Observer Codes . ir. When module is enabled, Some codes will run, Also when Module is disabled, Some codes will run, Each module need these enable/disable Observer codes, Anyway Possible?
No, you define your events yourself. The only predefined events are the ones that the framework itself triggers.
For events that need to be available system wide, most people create an events class, and have that "always_load". In the class you can define your event methods, and use the _init() static method to register your events, like so:
class Events { public static function _init() { \Event::register('some_event', 'Events::some_event'); }
public static function some_event() { \Log::info('Hurray, the event was triggered!'); } }
Then in your code, where you enable the module, you use
\Event::trigger('some_event');
to call the event method you have defined.
In your case, you need methods for 'enable module' and 'disable module', and you need to trigger the event in your controller that has the enable/disable functionality.