# Custom guard

Starting with Voyager 1.2 you can define a (custom) guard which is used throughout Voyager.\
To do so, just bind your auth-guard to `VoyagerAuth`.\
Open your `AuthServiceProvider` and add the following to the register method:

```php
$this->app->singleton('VoyagerAuth', function () {
    return Auth::guard('your-custom-guard');
});
```

Now this guard is used instead of the default guard.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://voyager-docs.devdojo.com/1.2/customization/custom-guard.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
