From 3257d3a99f3057f6ccd22370db1f30b3d44b598d Mon Sep 17 00:00:00 2001 From: Lalhmangaihenga Date: Sat, 2 Aug 2025 09:54:15 +0700 Subject: [PATCH 1/5] Update 03-creating-records.md --- docs/03-resources/03-creating-records.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/03-resources/03-creating-records.md b/docs/03-resources/03-creating-records.md index 1c47255e48..4c1e7d0426 100644 --- a/docs/03-resources/03-creating-records.md +++ b/docs/03-resources/03-creating-records.md @@ -324,16 +324,15 @@ public function hasSkippableSteps(): bool ### Sharing fields between the resource form and wizards -If you'd like to reduce the amount of repetition between the resource form and wizard steps, it's a good idea to extract public static resource functions for your fields, where you can easily retrieve an instance of a field from the resource or the wizard: +If you'd like to reduce the amount of repetition between the resource form and wizard steps, it's a good idea to extract public static resource functions for your fields, where you can easily retrieve an instance of a field from the schema or the wizard: ```php use Filament\Forms; -use Filament\Resources\Resource; use Filament\Schemas\Schema; -class CategoryResource extends Resource +class CategoryForm { - public static function form(Schema $schema): Schema + public static function configure(Schema $schema): Schema { return $schema ->components([ @@ -362,7 +361,7 @@ class CategoryResource extends Resource ``` ```php -use App\Filament\Resources\Categories\CategoryResource; +use App\Filament\Resources\Categories\Schemas\CategoryForm; use Filament\Resources\Pages\CreateRecord; class CreateCategory extends CreateRecord @@ -377,8 +376,8 @@ class CreateCategory extends CreateRecord Step::make('Name') ->description('Give the category a clear and unique name') ->schema([ - CategoryResource::getNameFormField(), - CategoryResource::getSlugFormField(), + CategoryForm::getNameFormField(), + CategoryForm::getSlugFormField(), ]), // ... ]; From cf7a463f3a479b79f4070710a454366f50e589fd Mon Sep 17 00:00:00 2001 From: Lalhmangaihenga Date: Sat, 2 Aug 2025 10:41:41 +0700 Subject: [PATCH 2/5] Update 03-creating-records.md include `form` on the description to make it more clear --- docs/03-resources/03-creating-records.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/03-resources/03-creating-records.md b/docs/03-resources/03-creating-records.md index 4c1e7d0426..90322ee6ac 100644 --- a/docs/03-resources/03-creating-records.md +++ b/docs/03-resources/03-creating-records.md @@ -324,7 +324,7 @@ public function hasSkippableSteps(): bool ### Sharing fields between the resource form and wizards -If you'd like to reduce the amount of repetition between the resource form and wizard steps, it's a good idea to extract public static resource functions for your fields, where you can easily retrieve an instance of a field from the schema or the wizard: +If you'd like to reduce the amount of repetition between the resource form and wizard steps, it's a good idea to extract public static resource functions for your fields, where you can easily retrieve an instance of a field from the form schema or the wizard: ```php use Filament\Forms; From baeb3236b8ea891c8a4fa19f754a03aff7718088 Mon Sep 17 00:00:00 2001 From: Lalhmangaihenga Date: Sat, 2 Aug 2025 10:44:28 +0700 Subject: [PATCH 3/5] Update 03-creating-records.md I am bad at wording --- docs/03-resources/03-creating-records.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/03-resources/03-creating-records.md b/docs/03-resources/03-creating-records.md index 90322ee6ac..50bde494cf 100644 --- a/docs/03-resources/03-creating-records.md +++ b/docs/03-resources/03-creating-records.md @@ -324,7 +324,7 @@ public function hasSkippableSteps(): bool ### Sharing fields between the resource form and wizards -If you'd like to reduce the amount of repetition between the resource form and wizard steps, it's a good idea to extract public static resource functions for your fields, where you can easily retrieve an instance of a field from the form schema or the wizard: +If you'd like to reduce the amount of repetition between the resource form and wizard steps, it's a good idea to extract public static configure functions for your fields, where you can easily retrieve an instance of a field from the form schema or the wizard: ```php use Filament\Forms; From a00300834402ea8c88fa80d6586159bae13d777d Mon Sep 17 00:00:00 2001 From: Lalhmangaihenga Date: Sat, 2 Aug 2025 18:33:31 +0700 Subject: [PATCH 4/5] update title --- docs/03-resources/03-creating-records.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/03-resources/03-creating-records.md b/docs/03-resources/03-creating-records.md index 50bde494cf..1dc50dcd90 100644 --- a/docs/03-resources/03-creating-records.md +++ b/docs/03-resources/03-creating-records.md @@ -322,7 +322,7 @@ public function hasSkippableSteps(): bool } ``` -### Sharing fields between the resource form and wizards +### Sharing fields between the schema form and wizards If you'd like to reduce the amount of repetition between the resource form and wizard steps, it's a good idea to extract public static configure functions for your fields, where you can easily retrieve an instance of a field from the form schema or the wizard: From 8b24c6db445be94eb300de122d85580e78b9593e Mon Sep 17 00:00:00 2001 From: Lalhmangaihenga Date: Sat, 2 Aug 2025 18:43:53 +0700 Subject: [PATCH 5/5] final-update-my-english-word-is-gone --- docs/03-resources/03-creating-records.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/03-resources/03-creating-records.md b/docs/03-resources/03-creating-records.md index 1dc50dcd90..b2d2eeedd0 100644 --- a/docs/03-resources/03-creating-records.md +++ b/docs/03-resources/03-creating-records.md @@ -322,9 +322,9 @@ public function hasSkippableSteps(): bool } ``` -### Sharing fields between the schema form and wizards +### Sharing fields between the form schema and wizards -If you'd like to reduce the amount of repetition between the resource form and wizard steps, it's a good idea to extract public static configure functions for your fields, where you can easily retrieve an instance of a field from the form schema or the wizard: +If you'd like to reduce the amount of repetition between the resource form and wizard steps, it's a good idea to extract public static form functions for your fields, where you can easily retrieve an instance of a field from the form schema or the wizard: ```php use Filament\Forms;