LaravelPackages.net
Acme Inc.
Toggle sidebar
maxwellimpact/laravel-password-reset

Laravel Password Reset Extension to enable Injected Repositories

5.918
1
v1.0.1
About maxwellimpact/laravel-password-reset

maxwellimpact/laravel-password-reset is a Laravel package for laravel password reset extension to enable injected repositories. It currently has 1 GitHub stars and 5.918 downloads on Packagist (latest version v1.0.1). Install it with composer require maxwellimpact/laravel-password-reset. Discover more Laravel packages by maxwellimpact or browse all Laravel packages to compare alternatives.

Last updated

Laravel Password Reset

Extends the default password reset for Laravel to enable custom Token repositories. It also adds an in memory Token Repository for testing.

Setup

Install

composer require maxwellimpact/laravel-password-reset

Add the Service Provider

In config/app.php replace Illuminate\Auth\Passwords\PasswordResetServiceProvider with Maxwellimpact\PasswordReset\PasswordResetServiceProvider

Note: If you are using Laravel 5.5 and up and have Package Discovery on, then just remove the original Laravel provider and it should work fine.

Register Your Custom Repository

Register your custom repository creator in one of your Service Providers boot method. The in_memory repository is already registered by default.

public function boot()
{
    Password::repository('in_memory', function($app, $config) {
        return new InMemoryTokenRepository($config['expire']);
    });
}

Configure the Repository

Add your settings in auth.php. The repository option is required for custom token repositories to be created, otherwise it defaults to the DatabaseTokenRepository that Laravel is hardcoded to. All config options will be passed in to your registered creator.

    ...
    'passwords' => [
        'users' => [
            'provider' => 'users',
            'repository' => 'in_memory',
            'expire' => 10,
        ],
    ]
Comments