From cf986534c1383c407972373d797025ba5bef7f99 Mon Sep 17 00:00:00 2001 From: Achyut Neupane Date: Tue, 31 Dec 2024 19:29:56 +0545 Subject: [PATCH 1/2] In CanGenerateForms trait --- packages/forms/src/Commands/Concerns/CanGenerateForms.php | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/forms/src/Commands/Concerns/CanGenerateForms.php b/packages/forms/src/Commands/Concerns/CanGenerateForms.php index e888f2eb40..0866150498 100644 --- a/packages/forms/src/Commands/Concerns/CanGenerateForms.php +++ b/packages/forms/src/Commands/Concerns/CanGenerateForms.php @@ -44,6 +44,7 @@ protected function getResourceFormSchema(string $model): string $componentData['type'] = match (true) { $type['name'] === 'boolean' => Forms\Components\Toggle::class, $type['name'] === 'date' => Forms\Components\DatePicker::class, + $type['name'] === 'time' => Forms\Components\TimePicker::class, in_array($type['name'], ['datetime', 'timestamp']) => Forms\Components\DateTimePicker::class, $type['name'] === 'text' => Forms\Components\Textarea::class, $columnName === 'image', str($columnName)->startsWith('image_'), str($columnName)->contains('_image_'), str($columnName)->endsWith('_image') => Forms\Components\FileUpload::class, From 195366e5ded656e5204f4c1ed9a2ba8a01ccf355 Mon Sep 17 00:00:00 2001 From: Achyut Neupane Date: Tue, 31 Dec 2024 19:30:34 +0545 Subject: [PATCH 2/2] In CanGenerateTables trait --- .../tables/src/Commands/Concerns/CanGenerateTables.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/tables/src/Commands/Concerns/CanGenerateTables.php b/packages/tables/src/Commands/Concerns/CanGenerateTables.php index 113fbf68ab..c61acded95 100644 --- a/packages/tables/src/Commands/Concerns/CanGenerateTables.php +++ b/packages/tables/src/Commands/Concerns/CanGenerateTables.php @@ -91,6 +91,13 @@ protected function getResourceTableColumns(string $model): string $columnData['sortable'] = []; } + if (in_array($type['name'], [ + 'time', + ])) { + $columnData['time'] = []; + $columnData['sortable'] = []; + } + if (in_array($type['name'], [ 'datetime', 'timestamp',