Skip to content

Fix BillableInterface::getKey() return type for Laravel compatibility#11

Merged
sandervanhooft merged 1 commit intomainfrom
fix/billable-interface-getkey-type
Feb 27, 2026
Merged

Fix BillableInterface::getKey() return type for Laravel compatibility#11
sandervanhooft merged 1 commit intomainfrom
fix/billable-interface-getkey-type

Conversation

@sandervanhooft
Copy link
Copy Markdown
Member

Fixes #10

Changed getKey() return type from string|int to mixed to match Laravel's Model::getKey() signature.

Without this fix, implementing BillableInterface on a Laravel model throws:

Declaration of Illuminate\Database\Eloquent\Model::getKey() must be compatible 
with Vatly\Fluent\Contracts\BillableInterface::getKey(): string|int

Changed return type from string|int to mixed to match Laravel's
Model::getKey() which returns mixed.
@sandervanhooft sandervanhooft merged commit 447efc0 into main Feb 27, 2026
3 checks passed
@sandervanhooft sandervanhooft deleted the fix/billable-interface-getkey-type branch February 27, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BillableInterface::getKey() type incompatible with Laravel Model

1 participant