Skip to content

Commit 40a82ee

Browse files
committed
laravel 8 support
1 parent 0db5ce9 commit 40a82ee

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/LaravelApiGenerator.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public function generateController()
4040
$template = str_replace('{{modelNameLower}}', strtolower($this->model), $template);
4141
$template = str_replace('{{modelNameCamel}}', Str::camel($this->model), $template);
4242
$template = str_replace('{{modelNameSpace}}', is_dir(base_path('app/Models')) ? 'Models\\'.$this->model : $this->model, $template);
43-
4443
file_put_contents(base_path('app/Http/Controllers/Api/'.$this->model.'Controller.php'), $template);
4544
$this->result = true;
4645
}
@@ -52,7 +51,7 @@ public function generateResource()
5251
{
5352
$this->result = false;
5453
if (! file_exists(base_path('app/Http/Resources/'.$this->model.'Resource.php'))) {
55-
$model = (is_dir(base_path('app/Models'))) ? app('App\\Models\\'.$this->model) : app('App\\'.$this->model);
54+
$model = is_dir(base_path('app/Models')) ? app('App\\Models\\'.$this->model) : app('App\\'.$this->model);
5655
$columns = $model->getConnection()->getSchemaBuilder()->getColumnListing($model->getTable());
5756
$print_columns = null;
5857
foreach ($columns as $key => $column) {
@@ -91,7 +90,6 @@ public function generateRoute()
9190
file_put_contents(base_path('routes/api.php'), $route, FILE_APPEND);
9291
$this->result = true;
9392
}
94-
9593
return $this->result;
9694
}
9795

0 commit comments

Comments
 (0)