Skip to content

Add MarshalOptions attributes to support Laravel Queue payload - #31

Open
yanlyan wants to merge 3 commits into
elliotchance:masterfrom
yanlyan:master
Open

Add MarshalOptions attributes to support Laravel Queue payload#31
yanlyan wants to merge 3 commits into
elliotchance:masterfrom
yanlyan:master

Conversation

@yanlyan

@yanlyan yanlyan commented Mar 29, 2023

Copy link
Copy Markdown
  • add LaravelQueue flag on MarshalOptions
  • add StructName on MarshalOptions option to custom class name

@elliotchance

Copy link
Copy Markdown
Owner
  • LaravelQueue is not relevant to this library.
  • I'm not convinced that StructName is useful either.

@yanlyan

yanlyan commented Mar 30, 2023

Copy link
Copy Markdown
Author

Hello @elliotchance
I'm new to open-source things, but can I fork this repo and use my customized library to meet my requirements?

@elliotchance

Copy link
Copy Markdown
Owner

You could fork it and modify it, but that is highly not recommended because now you'l have a separate version that won't be easy to update with bug fixes.

Some other approaches (with the most recommened at the top):

  1. Fix your input data so that you don't have to make changes. Either by decoding/encoding it through PHP or whatever.
  2. Decode the data into something more flexible like a map, then build the struct yourself by pulling out attributes as needed.
  3. Handle any augmentation before parsing it. You might do a string replace on the raw data, for example.

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.

3 participants