diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c5aa84..b3e9a53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `Filament-Generate-Helpers` will be documented in this file. +## 1.0.3 - 2025-01-07 + +- fix culomn function name + ## 1.0.2 - 2025-01-07 ### What's Changed diff --git a/src/Commands/Concerns/CanGenerateTablesHelper.php b/src/Commands/Concerns/CanGenerateTablesHelper.php index da32eda..4bdc46a 100644 --- a/src/Commands/Concerns/CanGenerateTablesHelper.php +++ b/src/Commands/Concerns/CanGenerateTablesHelper.php @@ -129,7 +129,8 @@ protected function getResourceTableColumns(string $model, bool $isFunCall = fals if ($isFunCall) { // code... foreach ($columns as $columnName => $columnData) { - $functionName = Str::camel("{$columnName}Column"); + $baseColumnName = Str::before($columnName, '.'); + $functionName = Str::camel("{$baseColumnName}Column"); $output .= "static::{$functionName}(),"; $output .= PHP_EOL; } @@ -141,7 +142,8 @@ protected function getResourceTableColumns(string $model, bool $isFunCall = fals foreach ($columns as $columnName => $columnData) { // Constructor $Prototype = '\\'.(string) str($columnData['type']); - $functionName = Str::camel("{$columnName}Column"); + $baseColumnName = Str::before($columnName, '.'); + $functionName = Str::camel("{$baseColumnName}Column"); $output .= PHP_EOL; $output .= '/**'.PHP_EOL; $output .= " * {$functionName}".PHP_EOL;