diff --git a/docs/credential-storage.md b/docs/credential-storage.md index d3b0258..eb72e4d 100644 --- a/docs/credential-storage.md +++ b/docs/credential-storage.md @@ -29,10 +29,34 @@ For the package to know which model you want to use, you will need to call the f ```php use Webfox\Xero\Xero; +use App\Models\Settings; -Xero::useModelStore(Settings::class); +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 diff --git a/docs/index.md b/docs/index.md index 3ee30f1..2978edd 100644 --- a/docs/index.md +++ b/docs/index.md @@ -62,12 +62,12 @@ return Application::configure(basePath: dirname(__DIR__)) #### Laravel 8-10 -Use the `reportable` method in the `App\Exceptions\Handler` class: +Use the `renderable` method in the `App\Exceptions\Handler` class: ```php public function register() { - $this->reportable(function (OAuthException $e) { + $this->renderable(function (OAuthException $e) { // Handle when the user clicks cancel on the Xero authorization screen return redirect('/my/xero/connect/page')->with('errorMessage', $e->getMessage()); });