Conditions | 2 |
Paths | 2 |
Total Lines | 20 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function generate() |
||
16 | { |
||
17 | $fullFilePaths = []; |
||
18 | $eventsType = config('laragen.options.events'); |
||
19 | |||
20 | foreach ($eventsType as $eventType) |
||
21 | { |
||
22 | $controllerTemplate = $this->buildTemplate(self::$template, [ |
||
23 | '{{namespace}}' => self::$namespace, |
||
24 | '{{modelName}}' => $this->module->getModelName(), |
||
25 | '{{eventTypeUppercase}}' => Str::ucfirst($eventType), |
||
26 | '{{eventTypeLowercase}}' => Str::lower($eventType) |
||
27 | ]); |
||
28 | |||
29 | $fullFilePath = $this->getPath(self::$destination."/").$this->module->getModelName().Str::ucfirst($eventType)."Notification".".php"; |
||
30 | $fullFilePaths[] = $fullFilePath; |
||
31 | file_put_contents($fullFilePath, $controllerTemplate); |
||
32 | } |
||
33 | |||
34 | return $fullFilePaths; |
||
35 | } |
||
38 |