-
Notifications
You must be signed in to change notification settings - Fork 20
Feat/model attribute conditions v4 compat #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 3.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,10 +1,17 @@ | ||||||
| <?php | ||||||
|
|
||||||
| declare(strict_types=1); | ||||||
|
|
||||||
| namespace Relaticle\CustomFields\Data; | ||||||
|
|
||||||
| use Spatie\LaravelData\Attributes\MapName; | ||||||
| use Spatie\LaravelData\Data; | ||||||
| use Spatie\LaravelData\Mappers\SnakeCaseMapper; | ||||||
|
|
||||||
| #[MapName(SnakeCaseMapper::class)] | ||||||
| class CustomFieldSectionSettingsData extends Data {} | ||||||
| class CustomFieldSectionSettingsData extends Data | ||||||
| { | ||||||
| public function __construct( | ||||||
| public VisibilityData $visibility = new VisibilityData, | ||||||
|
||||||
| public VisibilityData $visibility = new VisibilityData, | |
| public ?VisibilityData $visibility = null, |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Relaticle\CustomFields\Enums; | ||
|
|
||
| use Filament\Support\Contracts\HasLabel; | ||
|
|
||
| enum ConditionSource: string implements HasLabel | ||
| { | ||
| case CustomField = 'custom_field'; | ||
| case ModelAttribute = 'model_attribute'; | ||
|
|
||
| public function getLabel(): string | ||
| { | ||
| return match ($this) { | ||
| self::CustomField => 'Custom Field', | ||
| self::ModelAttribute => 'Model Attribute', | ||
| }; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Filament version constraint change from "^5.0" to "^4.0|^5.0" introduces backward compatibility with Filament v4. This is a significant change that should be thoroughly tested to ensure all features work correctly in both v4 and v5. Consider documenting any known differences or limitations when running on v4 vs v5.