We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0498c8f commit 0db5ce9Copy full SHA for 0db5ce9
src/LaravelApiGenerator.php
@@ -52,11 +52,7 @@ public function generateResource()
52
{
53
$this->result = false;
54
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
- }
+ $model = (is_dir(base_path('app/Models'))) ? app('App\\Models\\'.$this->model) : app('App\\'.$this->model);
60
$columns = $model->getConnection()->getSchemaBuilder()->getColumnListing($model->getTable());
61
$print_columns = null;
62
foreach ($columns as $key => $column) {
0 commit comments