# Storing Users Somewhere Custom

Build a custom user repository when file or Eloquent storage does not fit how your users need to work.

If you'd like to store your users somewhere outside the filesystem, and the included Eloquent implementation doesn't quite cut it for you,
you're free to write your own.

You will need to write implementations for all the contracts located in `Statamic\Contracts\Auth`. Of course, you may extend the native classes and override where appropriate, instead of writing everything from scratch.

In a service provider, use the `extend` method on the `UserRepositoryManager` to define a custom repository driver:

``` php
app(\Statamic\Auth\UserRepositoryManager::class)->extend('custom', function ($app, $config) {
    return new CustomUserRepository;
});
```

After you've registered the driver using the `extend` method, you'll want to create a repository in `config/statamic/users.php` that uses the new driver:

``` php
'repositories' => [
    'custom' => [
        'driver' => 'custom',
    ]
]
```

Finally, set that repository as the one you want active:

``` php
'repository' => 'custom'
```
