From 3373d8cd15c0ce86604080ba3ac8737935042921 Mon Sep 17 00:00:00 2001 From: James Freeman Date: Fri, 6 Dec 2024 07:39:11 +0000 Subject: [PATCH] update docs --- docs/credential-storage.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/docs/credential-storage.md b/docs/credential-storage.md index 1631c8f..6667289 100644 --- a/docs/credential-storage.md +++ b/docs/credential-storage.md @@ -31,9 +31,32 @@ For the package to know which model you want to use, you will need to call the f use Webfox\Xero\Xero; use App\Models\User; -Xero::useModelStore(User::find(1)); +Xero::useModelStore(Settings::first()); ``` +If you need to resolve a model depending on some application state such as the authenticated user, this should be added to [a custom middleware](https://laravel.com/docs/11.x/middleware#defining-middleware) instead of the app service provider, e.g. + +user()) { + Xero::useModelStore($request->user()->currentTeam); + } + + return $next($request); + + } +} + By default, the package will use the `xero_credentials` field, Should you need to rename this field, you can do so by calling: ```php