Closed JamesFreeman closed 6 days ago
This looks good to me. One of the developers at work has been using the beta version and ran into an interesting scenario - they wanted a per user storage, but not directly on the user.
In this case it was - user belongs to organisation, so we want the organisations xero credentials.
I don't believe this is a case we're current covering right?
Yeah, thinking this through at the moment, users would not be able to provide a dynamic model selection.
I was thinking as a potential solution, users could provide a callback on the useModelStore
for selection.
Xero::useModelStore(Team::class, fn($builder) => $builder->where('id', Auth::user()->currentTeamId));
If you're happy with this pr, let's get it merged in, and I'll create a new task for this. 👍
I've moved all code changes from this PR into #121 to make the AuthenicatedStore changes.
Yeah, thinking this through at the moment, users would not be able to provide a dynamic model selection.
I was thinking as a potential solution, users could provide a callback on the
useModelStore
for selection.Xero::useModelStore(Team::class, fn($builder) => $builder->where('id', Auth::user()->currentTeamId));
If you're happy with this pr, let's get it merged in, and I'll create a new task for this. 👍
Do you have any thoughts on this @hailwood?
Hey @hailwood,
Have you had any thoughts on this PR and the comment above?
I've made some changes to Auth User store, do take into account that users may be authenticated by a different guard.
I've also wrote some docs for the new Credential Storages: You can see a demo here:
https://jamesfreeman.github.io/laravel-xero-oauth2/credential-storage.html