I needed mine to be combined with the Eloquent provider since we are not using the standard User model / table.
In auth.php
'providers' => ['custom' => ['driver' => 'active-user-provider','model' => App\CustomModel::class, ] ]'guards' => ['web' => ['driver' => 'session','provider' => 'custom' ]],'passwords' => ['custom' => ['provider' => 'custom', .... ]]
In App\Extensions\ActiveUserProvider
class ActiveUserProvider extends EloquentUserProvider{ /** * Get a new query builder for the model instance. * * @param \Illuminate\Database\Eloquent\Model|null $model * @return \Illuminate\Database\Eloquent\Builder */ protected function newModelQuery($model = null) { return parent::newModelQuery($model) ->where('active', true); }}
In AuthServiceProvider
Auth::provider('active-user-provider', fn($app, array $config) => new ActiveUserProvider($app['hash'], $config['model']));
This way it also only sends password reset emails to active workers.