PHPackages                             codenrx/forgetpassword - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. codenrx/forgetpassword

ActiveLibrary

codenrx/forgetpassword
======================

This is a Laravel Package For Forget Password System

316PHP

Since Sep 5Pushed 6y agoCompare

[ Source](https://github.com/codenrx/laravel-forget-password)[ Packagist](https://packagist.org/packages/codenrx/forgetpassword)[ RSS](/packages/codenrx-forgetpassword/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Forget Password
=======================

[](#laravel-forget-password)

This is a Laravel Package For Forget Password System where you send link to user's email for reseting password

**Please read the full docs , before use !**

Install
=======

[](#install)

```
composer require codenrx/forgetpassword
```

add these line in `providers` array of `config/app.php`

```
codenrx\forgetpassword\ForgetpasswordServiceProvider::class,
```

then , use these command to publish package config file (forgetpassword.php) in `config` folder and email template in `views` folder .

```
php artisan vendor:publish --provider="codenrx\forgetpassword\ForgetpasswordServiceProvider"
```

open to `.env` file on your project &amp; also setup database &amp; mail connection . Then,

```
php artisan migrate
```

Usage
=====

[](#usage)

add these line on top of your controller

```
use codenrx\forgetpassword\Model\Password;
```

Then,

```
Password::send($email);
```

here , `$email` content user email . You can pass `$request->email` or anything .

`Password::send($email)` Helps you to send links to user's email . Note that its also check , if user have or not !! if user not found . I mean email is not exixts in database . It's return `failed`. Otherwise its return `success`

### this package only return 2 thing

[](#this-package-only-return-2-thing)

1. failed
2. success

### Other methods are :

[](#other-methods-are-)

1. `Password::check($token)` : it's help you to check if token exixts in database or not !!
2. `Password::updatePassword($password, $token)`Here `$password` will be user's new password

example :
=========

[](#example-)

### Route :

[](#route-)

```
// Forget Password page
Route::get('/forget-password', 'forgetController@index');
Route::post('/forget-password', 'forgetController@send');

// reset password page
Route::get('/reset-password/{token}', 'forgetController@check');
Route::post('/reset-password/{token}', 'forgetController@update');
```

**update your config file :**

go to `config/forgetpassword.php`. then you see ,

```
