Skip to content

Commit b8f7db7

Browse files
authored
Merge pull request #13 from bhavingajjar/analysis-OMDQ4B
Apply fixes from StyleCI
2 parents 04c7239 + dbf5025 commit b8f7db7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

config/config.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
|
1515
*/
1616

17-
'model_directory_path' => is_dir(base_path('app/Models')) ? 'app/Models':'app',
17+
'model_directory_path' => is_dir(base_path('app/Models')) ? 'app/Models' : 'app',
1818

1919
'allow_cross_origin' => env('API_ALLOW_CROSS_ORIGIN', false),
2020
'json_response' => env('API_JSON_RESPONSE', true),

src/LaravelApiGenerator.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@ public function generateCollection()
8383
public function generateRoute()
8484
{
8585
$this->result = false;
86-
if(app()->version() >= 8 ){
86+
if (app()->version() >= 8) {
8787
$nameSpace = "\nuse App\Http\Controllers\Api\{{modelName}}Controller;";
8888
$template = "Route::apiResource('{{modelNameLower}}', {{modelName}}Controller::class);\n";
8989
$nameSpace = str_replace('{{modelName}}', $this->model, $nameSpace);
90-
}else{
90+
} else {
9191
$template = "Route::apiResource('{{modelNameLower}}', 'Api\{{modelName}}Controller');\n";
9292
}
9393
$route = str_replace('{{modelNameLower}}', Str::camel(Str::plural($this->model)), $template);
9494
$route = str_replace('{{modelName}}', $this->model, $route);
9595
if (! strpos(file_get_contents(base_path('routes/api.php')), $route)) {
9696
file_put_contents(base_path('routes/api.php'), $route, FILE_APPEND);
97-
if(app()->version() >= 8 ){
97+
if (app()->version() >= 8) {
9898
if (! strpos(file_get_contents(base_path('routes/api.php')), $nameSpace)) {
9999
$lines = file(base_path('routes/api.php'));
100100
$lines[0] = $lines[0]."\n".$nameSpace;
@@ -103,6 +103,7 @@ public function generateRoute()
103103
}
104104
$this->result = true;
105105
}
106+
106107
return $this->result;
107108
}
108109

0 commit comments

Comments
 (0)