Skip to content

Honour optional flag in $laravelModel->interfaces to support optional relationships - #123

Merged
tcampbPPU merged 4 commits into
fumeapp:masterfrom
cjholowatyj:master
Jun 12, 2026
Merged

Honour optional flag in $laravelModel->interfaces to support optional relationships#123
tcampbPPU merged 4 commits into
fumeapp:masterfrom
cjholowatyj:master

Conversation

@cjholowatyj

Copy link
Copy Markdown
Contributor

Problem

Currently when overriding default behaviour by using the $laravelModel->interfaces property on the model class, the optional property is dropped when attempting to mark a relationship as optional (instead of null).

Solution

The following code appends the optional parameter to the interfaced mapped through in BuildModelDetails.php, and includes a check for it in WriteColumnAttribute.php so that optional relationships can also be emitted as relationship?:

@tcampbPPU
tcampbPPU merged commit 58ca0f5 into fumeapp:master Jun 12, 2026
26 checks passed
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.

2 participants