Skip to content
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

Question: Packages #450

Open
plunkettscott opened this issue Nov 5, 2019 · 4 comments
Open

Question: Packages #450

plunkettscott opened this issue Nov 5, 2019 · 4 comments
Milestone

Comments

@plunkettscott
Copy link

plunkettscott commented Nov 5, 2019

The packages config item in this Laravel package is the current way we list the packages to be registered with the laravel-json-api package. However, I am wanting to keep people out of the base application config now, unless they truly understand what they are doing. The application is supposed to be extensible, but complete.

Our modular application takes extensions that are registered at run-time via a service provider. Is there a way we can dynamically register packages with the laravel-json-api package that I'm not seeing? I've looked through various pieces and don't quite see how it's happening. I haven't spent much time on it, hoping there was some gem of a method somewhere to allow me to pass a package resolver to it and register it with the application.

Right now, the only thing I can think of is to dynamically set the config key at run-time, which is less than ideal.

Thanks for your help!

@plunkettscott
Copy link
Author

Also, another reason the current method does not work for us is that when we ship our application as a Docker container, the config files are not easily accessible to modify and add packages through our extensions that are enabled/disabled/configured using database tables.

@lindyhopchris
Copy link
Member

So the packages are only supported via config at the moment. Haven't had a request like yours before, so this would definitely be a new feature. Not adverse to putting it in though as programmatically adding packages doesn't seem unreasonable!

APIs are built via a repository at the moment, so adding a public method to that repository that allows you to register them would be fine... the method would need to take the API name and the container binding name for the provider.

I'm highly unlikely to get to this anytime soon though based on current workload so if you're keen for it sometime soon then you'll have to PR it (though I can help through discussion on this issue as to how to put it together).

@lindyhopchris lindyhopchris added this to the 1.x milestone Nov 6, 2019
@plunkettscott
Copy link
Author

@lindyhopchris,

Definitely interested in starting on this. It's a feature we'd like to use for sure. Can you point me in the right direction of the repository that I'd tap into to register packages? I'm not following where the packages get resolved aside from AggregateResolver.

Scott

@lindyhopchris
Copy link
Member

@plunkettscott just wanted to check in with you as the issue is a bit old... is this something you need or did you manage to sort it out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants