Skip to content

Commit 49683b3

Browse files
authored
Merge pull request #120 from Cadienvan/patch-1
fix: HasModel missing 'use'
2 parents 252f7b9 + 99d4e3e commit 49683b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Http/Api/Contracts/HasModel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ protected function setTableColumns(?Model $model = null): void
141141
$table = $this->getUnqualifiedTableName($model);
142142

143143
if (config('laravel-api-controller.cache_table_columns')) {
144-
$columns = Cache::remember(config('laravel-api-controller.cache_table_columns_prefix').$table, config('laravel-api-controller.cache_table_columns_ttl'), function() { return Schema::connection($model->getConnectionName())->getColumnListing($table);});
144+
$columns = Cache::remember(config('laravel-api-controller.cache_table_columns_prefix').$table, config('laravel-api-controller.cache_table_columns_ttl'), function() use ($model, $table) { return Schema::connection($model->getConnectionName())->getColumnListing($table);});
145145
} else {
146146
$columns = Schema::connection($model->getConnectionName())->getColumnListing($table);
147147
}

0 commit comments

Comments
 (0)