@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | public function boot() |
14 | 14 | { |
15 | 15 | $this->publishes([ |
16 | - __DIR__ . '/../config/laragen.php' => config_path('laragen.php') |
|
16 | + __DIR__.'/../config/laragen.php' => config_path('laragen.php') |
|
17 | 17 | ], 'config'); |
18 | 18 | |
19 | 19 | Artisan::call('vendor:publish', [ |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public function register() |
27 | 27 | { |
28 | 28 | $this->mergeConfigFrom( |
29 | - __DIR__ . '/../config/laragen.php', |
|
29 | + __DIR__.'/../config/laragen.php', |
|
30 | 30 | 'laragen' |
31 | 31 | ); |
32 | 32 |
@@ -5,7 +5,7 @@ |
||
5 | 5 | |
6 | 6 | class BaseGenerator |
7 | 7 | { |
8 | - protected $module; |
|
8 | + protected $module; |
|
9 | 9 | |
10 | 10 | public function __construct(Module $module) |
11 | 11 | { |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | public function getStub($type) |
26 | 26 | { |
27 | - return file_get_contents(__DIR__ . "/../resources/stubs/" . $type . ".stub"); |
|
27 | + return file_get_contents(__DIR__."/../resources/stubs/".$type.".stub"); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | public function buildTemplate($stub, $replacements) |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | public function getTabs($number) |
36 | 36 | { |
37 | 37 | $schema = ""; |
38 | - for ($i=0; $i < $number; $i++) { |
|
38 | + for ($i = 0; $i < $number; $i++) { |
|
39 | 39 | $schema .= " "; |
40 | 40 | } |
41 | 41 | return $schema; |
@@ -13,6 +13,6 @@ |
||
13 | 13 | '{{modelNameSingularLowerCase}}' => strtolower($this->module->getModelName()) |
14 | 14 | ]); |
15 | 15 | |
16 | - file_put_contents(base_path("app/Http/Controllers/" . $this->module->getModelName() . "Controller" . ".php"), $controllerTemplate); |
|
16 | + file_put_contents(base_path("app/Http/Controllers/".$this->module->getModelName()."Controller".".php"), $controllerTemplate); |
|
17 | 17 | } |
18 | 18 | } |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | '{{modelTableSchema}}' => $this->getSchema() |
18 | 18 | ]); |
19 | 19 | |
20 | - $dateSuffix = (int)date('His') + ++self::$counter; |
|
21 | - file_put_contents(database_path() . "/migrations/" . date('Y_m_d_') . $dateSuffix . "_create_" . $this->module->getModuleName() . "_table.php", $migrationTemplate); |
|
20 | + $dateSuffix = (int) date('His') + ++self::$counter; |
|
21 | + file_put_contents(database_path()."/migrations/".date('Y_m_d_').$dateSuffix."_create_".$this->module->getModuleName()."_table.php", $migrationTemplate); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | protected function getSchema() |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $schema .= $option->getSchema(); |
34 | 34 | |
35 | 35 | if ($column != $lastColumn) { |
36 | - $schema .= PHP_EOL . $this->getTabs(3); |
|
36 | + $schema .= PHP_EOL.$this->getTabs(3); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | '{{foreignMethods}}' => $this->getForeignMethods() |
14 | 14 | ]); |
15 | 15 | |
16 | - file_put_contents(base_path("app/Models/" . $this->module->getModelName() . ".php"), $modelTemplate); |
|
16 | + file_put_contents(base_path("app/Models/".$this->module->getModelName().".php"), $modelTemplate); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | protected function getMassAssignables() |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | foreach ($this->module->getData() as $column => $optionString) { |
24 | 24 | $optionArray = explode(':', $optionString); |
25 | 25 | if (in_array($optionArray[0], ['string', 'int', 'text', 'bool', 'date'])) { |
26 | - $massAssignables[] = "'" . $column . "'"; |
|
26 | + $massAssignables[] = "'".$column."'"; |
|
27 | 27 | } |
28 | 28 | } |
29 | 29 |
@@ -13,6 +13,6 @@ |
||
13 | 13 | '{{modelNameSingularLowerCase}}' => strtolower($this->module->getModelName()) |
14 | 14 | ]); |
15 | 15 | |
16 | - file_put_contents(base_path("app/Http/Controllers/" . $this->module->getModelName() . "Controller" . ".php"), $controllerTemplate); |
|
16 | + file_put_contents(base_path("app/Http/Controllers/".$this->module->getModelName()."Controller".".php"), $controllerTemplate); |
|
17 | 17 | } |
18 | 18 | } |