@@ -9,7 +9,7 @@ |
||
| 9 | 9 | class Notification extends BaseGenerator implements GeneratorInterface |
| 10 | 10 | { |
| 11 | 11 | private static $destination = "laragen/app/Notifications"; |
| 12 | - private static $namespace = "Laragen\App\Notifications"; |
|
| 12 | + private static $namespace = "Laragen\App\Notifications"; |
|
| 13 | 13 | private static $template = "backend/notifications/notification"; |
| 14 | 14 | |
| 15 | 15 | public function generate() |
@@ -8,12 +8,12 @@ |
||
| 8 | 8 | class Model extends BaseGenerator implements GeneratorInterface |
| 9 | 9 | { |
| 10 | 10 | protected $destination = "laragen/app/Models"; |
| 11 | - protected $namespace = "Laragen\App\Models"; |
|
| 11 | + protected $namespace = "Laragen\App\Models"; |
|
| 12 | 12 | protected $template = "common/Models/Model"; |
| 13 | 13 | protected $pivotTemplate = "common/Models/Pivot"; |
| 14 | 14 | |
| 15 | 15 | protected $childDestination = "app/Models"; |
| 16 | - protected $childNamespace = "App\Models"; |
|
| 16 | + protected $childNamespace = "App\Models"; |
|
| 17 | 17 | |
| 18 | 18 | public function generate() |
| 19 | 19 | { |
@@ -77,9 +77,9 @@ discard block |
||
| 77 | 77 | { |
| 78 | 78 | $filteredTypes = []; |
| 79 | 79 | $options = is_array($options) ? $options : [$options]; |
| 80 | - foreach($this->getPivotColumns() as $type){ |
|
| 80 | + foreach ($this->getPivotColumns() as $type) { |
|
| 81 | 81 | foreach ($options as $option) { |
| 82 | - if($type->$option()){ |
|
| 82 | + if ($type->$option()) { |
|
| 83 | 83 | $filteredTypes[] = $columnsOnly ? $type->getColumn() : $type; |
| 84 | 84 | break; |
| 85 | 85 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | public function getForeignKey() |
| 118 | 118 | { |
| 119 | - return $this->columnName . "_id"; |
|
| 119 | + return $this->columnName."_id"; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | public function getRelatedModel() |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | public function getChildModel() |
| 138 | 138 | { |
| 139 | - return ucfirst(Str::camel(Str::singular($this->typeOption ?? $this->columnName ))); |
|
| 139 | + return ucfirst(Str::camel(Str::singular($this->typeOption ?? $this->columnName))); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | public function getParentModel() |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | protected function updateSeeder() { |
| 160 | 160 | $laragenSeederFile = $this->getPath("database/seeds/")."LaragenSeeder.php"; |
| 161 | 161 | |
| 162 | - if(self::$initializeFlag++ == 0) |
|
| 162 | + if (self::$initializeFlag++ == 0) |
|
| 163 | 163 | $this->initializeFile($laragenSeederFile, 'common/Seeder'); |
| 164 | 164 | |
| 165 | 165 | $this->insertIntoFile( |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $this->insertIntoFile( |
| 214 | 214 | $laragenSeederFile, |
| 215 | 215 | "\n // End factories", |
| 216 | - "\n".$this->getTabs(2)."factory(".$type->getPivot()."::class, " . ((int) config('laragen.options.seed_rows') * 2) . ")->create();", |
|
| 216 | + "\n".$this->getTabs(2)."factory(".$type->getPivot()."::class, ".((int) config('laragen.options.seed_rows') * 2).")->create();", |
|
| 217 | 217 | false |
| 218 | 218 | ); |
| 219 | 219 | } |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | ]; |
| 37 | 37 | |
| 38 | 38 | foreach ($migrationDirs as $dir) { |
| 39 | - if(is_dir(base_path($dir)) && count(glob( base_path($dir) . '*', GLOB_MARK ))){ |
|
| 39 | + if (is_dir(base_path($dir)) && count(glob(base_path($dir).'*', GLOB_MARK))) { |
|
| 40 | 40 | Artisan::call('migrate', [ |
| 41 | 41 | '--path' => $dir |
| 42 | 42 | ]); |
@@ -45,11 +45,11 @@ |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function getModule($name) { |
| 48 | - if(isset($this->modules[$name])){ |
|
| 48 | + if (isset($this->modules[$name])) { |
|
| 49 | 49 | return $this->modules[$name]; |
| 50 | 50 | } |
| 51 | - else{ |
|
| 52 | - throw new \Exception("Module '". $name. "' not found"); |
|
| 51 | + else { |
|
| 52 | + throw new \Exception("Module '".$name."' not found"); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | 'xs' => '200x200', |
| 26 | 26 | ], |
| 27 | 27 | 'events' => [ |
| 28 | - 'created','updated','deleted' |
|
| 28 | + 'created', 'updated', 'deleted' |
|
| 29 | 29 | ], |
| 30 | 30 | 'seed_rows' => 25, |
| 31 | 31 | 'listing_per_page' => 20, |
@@ -22,13 +22,13 @@ |
||
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | public function removeDir($dir) { |
| 25 | - if (! is_dir($dir)) { |
|
| 25 | + if (!is_dir($dir)) { |
|
| 26 | 26 | throw new InvalidArgumentException("$dir must be a directory"); |
| 27 | 27 | } |
| 28 | 28 | if (substr($dir, strlen($dir) - 1, 1) != '/') { |
| 29 | 29 | $dir .= '/'; |
| 30 | 30 | } |
| 31 | - $files = glob($dir . '*', GLOB_MARK); |
|
| 31 | + $files = glob($dir.'*', GLOB_MARK); |
|
| 32 | 32 | foreach ($files as $file) { |
| 33 | 33 | if (is_dir($file)) { |
| 34 | 34 | $this->removeDir($file); |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $this->line("Cleaning code directory ..."); |
| 50 | 50 | |
| 51 | 51 | foreach ([base_path('laragen/app'), base_path('laragen/database')] as $dir) { |
| 52 | - if(file_exists($dir)){ |
|
| 52 | + if (file_exists($dir)) { |
|
| 53 | 53 | $fileSystem->removeDir($dir); |
| 54 | 54 | } |
| 55 | 55 | } |