@@ -70,10 +70,12 @@ |
||
70 | 70 | |
71 | 71 | $routeFile = app_path('Providers/LaragenRouteServiceProvider.php'); |
72 | 72 | $observerFile = app_path('Providers/LaragenObserverServiceProvider.php'); |
73 | - if (file_exists($routeFile)) |
|
74 | - $this->app->register("\App\Providers\LaragenRouteServiceProvider"); |
|
75 | - if (file_exists($observerFile)) |
|
76 | - $this->app->register("\App\Providers\LaragenObserverServiceProvider"); |
|
73 | + if (file_exists($routeFile)) { |
|
74 | + $this->app->register("\App\Providers\LaragenRouteServiceProvider"); |
|
75 | + } |
|
76 | + if (file_exists($observerFile)) { |
|
77 | + $this->app->register("\App\Providers\LaragenObserverServiceProvider"); |
|
78 | + } |
|
77 | 79 | } |
78 | 80 | /** |
79 | 81 | * To register laragen as first level command. E.g. laragen:generate |
@@ -13,8 +13,9 @@ discard block |
||
13 | 13 | public function __construct() |
14 | 14 | { |
15 | 15 | $this->middleware(function ($request, $next) { |
16 | - if(!auth()->user()->getRoleNames()->contains('super-admin')) |
|
17 | - abort(403, 'Access denied'); |
|
16 | + if(!auth()->user()->getRoleNames()->contains('super-admin')) { |
|
17 | + abort(403, 'Access denied'); |
|
18 | + } |
|
18 | 19 | return $next($request); |
19 | 20 | }); |
20 | 21 | |
@@ -44,8 +45,9 @@ discard block |
||
44 | 45 | return $perm; |
45 | 46 | })->groupBy(function ($perm) { |
46 | 47 | foreach (array_keys(app('laragen')->getModules()) as $module) { |
47 | - if(Str::contains($perm->name, str_replace('_', ' ', $module))) |
|
48 | - return Str::title(str_replace('_', ' ', $module)); |
|
48 | + if(Str::contains($perm->name, str_replace('_', ' ', $module))) { |
|
49 | + return Str::title(str_replace('_', ' ', $module)); |
|
50 | + } |
|
49 | 51 | } |
50 | 52 | return "Others"; |
51 | 53 | }), |
@@ -63,8 +65,9 @@ discard block |
||
63 | 65 | return $perm; |
64 | 66 | })->groupBy(function ($perm) { |
65 | 67 | foreach (array_keys(app('laragen')->getModules()) as $module) { |
66 | - if(Str::contains($perm->name, str_replace('_', ' ', $module))) |
|
67 | - return Str::title(str_replace('_', ' ', $module)); |
|
68 | + if(Str::contains($perm->name, str_replace('_', ' ', $module))) { |
|
69 | + return Str::title(str_replace('_', ' ', $module)); |
|
70 | + } |
|
68 | 71 | } |
69 | 72 | return "Others"; |
70 | 73 | }), |
@@ -76,8 +79,9 @@ discard block |
||
76 | 79 | */ |
77 | 80 | public function store(Request $request) |
78 | 81 | { |
79 | - if (!$request->name) |
|
80 | - return redirect()->back()->withErrors(['name' => 'Name cannot be empty.']); |
|
82 | + if (!$request->name) { |
|
83 | + return redirect()->back()->withErrors(['name' => 'Name cannot be empty.']); |
|
84 | + } |
|
81 | 85 | |
82 | 86 | $role = Role::create(['name' => $request->name]); |
83 | 87 | $role->permissions()->attach($request->permissions); |
@@ -194,8 +194,9 @@ |
||
194 | 194 | |
195 | 195 | protected function getPath($path) |
196 | 196 | { |
197 | - if (!is_dir($path)) |
|
198 | - mkdir($path, 0755, true); |
|
197 | + if (!is_dir($path)) { |
|
198 | + mkdir($path, 0755, true); |
|
199 | + } |
|
199 | 200 | |
200 | 201 | return $path; |
201 | 202 | } |
@@ -45,8 +45,9 @@ discard block |
||
45 | 45 | $data = new TypeResolver($this->name, $column, $typeOptions); |
46 | 46 | $type = $data->getLaragenType(); |
47 | 47 | $this->columnsData[$column] = $type; |
48 | - if($type->isDisplay()) |
|
49 | - $this->displayColumns[] = $type; |
|
48 | + if($type->isDisplay()) { |
|
49 | + $this->displayColumns[] = $type; |
|
50 | + } |
|
50 | 51 | } |
51 | 52 | |
52 | 53 | if(sizeof($this->displayColumns)==0){ |
@@ -143,7 +144,7 @@ discard block |
||
143 | 144 | } |
144 | 145 | if($columnsOnly){ |
145 | 146 | $columns[] = $type->getColumnKey(); |
146 | - }else{ |
|
147 | + } else{ |
|
147 | 148 | $columns[$type->getColumnKey()] = $type; |
148 | 149 | } |
149 | 150 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | if (is_dir($src)) { |
14 | 14 | $this->mirror($src, $dest."/".basename($src)); |
15 | - }else{ |
|
15 | + } else{ |
|
16 | 16 | $this->copy($src, $dest); |
17 | 17 | } |
18 | 18 | } |
@@ -16,8 +16,9 @@ |
||
16 | 16 | } |
17 | 17 | |
18 | 18 | public function getTextRows() { |
19 | - if (!$this->size) |
|
20 | - return 4; |
|
19 | + if (!$this->size) { |
|
20 | + return 4; |
|
21 | + } |
|
21 | 22 | |
22 | 23 | return floor($this->getsize() / 120); |
23 | 24 | } |
@@ -158,8 +158,9 @@ |
||
158 | 158 | |
159 | 159 | |
160 | 160 | public function getTextRows() { |
161 | - if (!$this->size) |
|
162 | - return 4; |
|
161 | + if (!$this->size) { |
|
162 | + return 4; |
|
163 | + } |
|
163 | 164 | |
164 | 165 | return floor($this->getsize() / 120); |
165 | 166 | } |
@@ -16,8 +16,9 @@ |
||
16 | 16 | |
17 | 17 | foreach ($existingMigrationFiles as $file) { |
18 | 18 | $file = database_path("migrations/laragen") . "/" . $file; |
19 | - if (is_file($file)) |
|
20 | - unlink($file); |
|
19 | + if (is_file($file)) { |
|
20 | + unlink($file); |
|
21 | + } |
|
21 | 22 | } |
22 | 23 | } |
23 | 24 |
@@ -147,7 +147,9 @@ |
||
147 | 147 | $foreignData = ""; |
148 | 148 | |
149 | 149 | foreach($types as $type){ |
150 | - if($type->hasSelfParent()) continue; |
|
150 | + if($type->hasSelfParent()) { |
|
151 | + continue; |
|
152 | + } |
|
151 | 153 | $foreignData .= $this->buildTemplate('common/Factories/fragments/options', [ |
152 | 154 | '{{parent}}' => $type->getColumnKey(), |
153 | 155 | '{{parentModel}}' => $type->getRelatedModel() |