diff --git a/src/Commands/ActionCommand.php b/src/Commands/ActionCommand.php index 6df6eb0..5b3c658 100644 --- a/src/Commands/ActionCommand.php +++ b/src/Commands/ActionCommand.php @@ -10,10 +10,15 @@ class ActionCommand extends GeneratorCommand protected $signature = 'ussd:action {name : The name of the USSD Action} + {--init : Create the class as the initial USSD action} {--force : Create the class even if USSD action already exists}'; protected function getStub() { + if ($this->option('init')) { + return __DIR__.'/../../stubs/action.init.stub'; + } + return __DIR__.'/../../stubs/action.stub'; } diff --git a/src/Commands/StateCommand.php b/src/Commands/StateCommand.php index 5c6d87c..6a60c43 100644 --- a/src/Commands/StateCommand.php +++ b/src/Commands/StateCommand.php @@ -10,10 +10,15 @@ class StateCommand extends GeneratorCommand protected $signature = 'ussd:state {name : The name of the USSD State} + {--init : Create the class as the initial USSD state} {--force : Create the class even if USSD state already exists}'; protected function getStub() { + if ($this->option('init')) { + return __DIR__.'/../../stubs/state.init.stub'; + } + return __DIR__.'/../../stubs/state.stub'; } diff --git a/stubs/action.init.stub b/stubs/action.init.stub new file mode 100644 index 0000000..0eb283e --- /dev/null +++ b/stubs/action.init.stub @@ -0,0 +1,13 @@ +text(''); + } +}