Skip to content

Commit

Permalink
Creating View Group added
Browse files Browse the repository at this point in the history
  • Loading branch information
cybersai committed Dec 20, 2019
1 parent 9dce4ba commit b9e0a98
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 2 deletions.
30 changes: 30 additions & 0 deletions src/Console/Commands/CreateViewGroup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace CyberSai\LaravelUSSD\Console\Commands;

use Illuminate\Console\GeneratorCommand;

class CreateViewGroup extends GeneratorCommand
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $name = 'command:name';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Create new USSD View Group';

protected $type = 'View Group';

protected function getStub()
{
return __DIR__.'/Stubs/ussd_view_group.stub';
}

}
30 changes: 30 additions & 0 deletions src/Console/Commands/CreateViewValidator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace CyberSai\LaravelUSSD\Console\Commands;

use Illuminate\Console\GeneratorCommand;


class CreateViewValidator extends GeneratorCommand
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $name = 'command:name';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Create USSD View Validator';

protected $type = 'View Validator';

protected function getStub()
{
return __DIR__.'/Stubs/ussd_view_validator.stub';
}
}
16 changes: 16 additions & 0 deletions src/Console/Commands/Stubs/ussd_view_group.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
namespace DummyNamespace;

class DummyClass extends \Cybersai\Ussd\Templates\TemplateViewGroup
{
public function __construct($request)
{
$this->views = [];
parent::__construct($request);
}

public function getSelectedView()
{
// TODO: Implement getSelectedView() method.
}
}
17 changes: 17 additions & 0 deletions src/Console/Commands/Stubs/ussd_view_validator.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
namespace DummyNamespace;

class DummyClass extends \Cybersai\Ussd\Templates\TemplateViewValidator
{
public function __construct($request)
{
$this->views = [];
parent::__construct($request);
}

function getValidView()
{
// TODO: Implement getValidView() method.
}

}
8 changes: 6 additions & 2 deletions src/UssdServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
use CyberSai\LaravelUssd\Console\Commands\CreateModel;
use CyberSai\LaravelUssd\Console\Commands\CreateSimpleView;
use CyberSai\LaravelUssd\Console\Commands\CreateTitledView;
use CyberSai\LaravelUSSD\Console\Commands\CreateViewGroup;
use CyberSai\LaravelUSSD\Console\Commands\CreateViewValidator;
use Illuminate\Support\ServiceProvider;

class UssdServiceProvider extends ServiceProvider
Expand All @@ -29,7 +31,9 @@ public function boot()
CreateSimpleView::class,
CreateTitledView::class,
CreateListView::class,
CreateController::class
CreateController::class,
CreateViewGroup::class,
CreateViewValidator::class
]);
}
}
Expand All @@ -41,4 +45,4 @@ public function register()
{
$this->mergeConfigFrom(__DIR__ . '/../config/ussd.php', 'config');
}
}
}

0 comments on commit b9e0a98

Please sign in to comment.