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