Skip to content

Commit 0db5ce9

Browse files
committed
laravel 8 support
1 parent 0498c8f commit 0db5ce9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/LaravelApiGenerator.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,7 @@ public function generateResource()
5252
{
5353
$this->result = false;
5454
if (! file_exists(base_path('app/Http/Resources/'.$this->model.'Resource.php'))) {
55-
if(is_dir(base_path('app/Models'))){
56-
$model = app('App\\Models\\'.$this->model);
57-
}else{
58-
$model = app('App\\'.$this->model);
59-
}
55+
$model = (is_dir(base_path('app/Models'))) ? app('App\\Models\\'.$this->model) : app('App\\'.$this->model);
6056
$columns = $model->getConnection()->getSchemaBuilder()->getColumnListing($model->getTable());
6157
$print_columns = null;
6258
foreach ($columns as $key => $column) {

0 commit comments

Comments
 (0)