Completed
Push — master ( b9481e...fee819 )
by Prateek
04:31 queued 02:08
created

Controller::generate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Prateekkarki\Laragen\Generators;
4
use Prateekkarki\Laragen\Models\Module;
5
6
class Controller extends BaseGenerator implements GeneratorInterface
7
{
8
    public function generate()
9
    {
10
        $controllerTemplate = $this->buildTemplate('Controller', [
11
            '{{modelName}}'                  => $this->module->getModelName(),
12
            '{{moduleName}}'                 => $this->module->getModuleName(),
13
            '{{modelNameSingularLowerCase}}' => strtolower($this->module->getModelName())
14
        ]);
15
16
        file_put_contents(base_path("app/Http/Controllers/" . $this->module->getModelName() . "Controller" . ".php"), $controllerTemplate);
17
    }
18
}
19