Skip to content
This repository has been archived by the owner on Jul 10, 2019. It is now read-only.

Commit

Permalink
Updated to reflect reminders changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ollieread committed Feb 21, 2014
1 parent e545ab0 commit 347bcc1
Showing 1 changed file with 46 additions and 5 deletions.
51 changes: 46 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Firstly you want to include this package in your composer.json file.

Next you open up app/config/app.php and replace the AuthServiceProvider with

Ollieread\Multiauth\MultiauthServiceProvider
"Ollieread\Multiauth\MultiauthServiceProvider"

Configuration is pretty easy too, take app/config/auth.php with its default values:

Expand Down Expand Up @@ -76,6 +76,51 @@ Now remove the first three options and replace as follows:

);

## Reminders ##

If you wish to use reminders, you will need to replace ReminderServiceProvider in you
app/config/app.php file with the following.

Ollieread\Multiauth\Reminders\ReminderServiceProvider

To generate the reminders table you will need to run the following command.

php artisan multiauth:reminders-table

The `reminders-controller` command has been removed, as it wouldn't work with the
way this package handles authentication. I do plan to look into this in the future.

The concept is the same as the default Auth reminders, except you access everything
the same way you do using the rest of this package, in that prefix methods with the
authentication type.

To send a reminder you would do the following.

Password::account()->remind(Input::only('email'), function($message) {
$message->subject('Password reminder');
});

And to reset a password you would do the following.

Password::account()->reset($credentials, function($user, $password) {
$user->password = Hash::make($password);
$user->save();
});

For simple identification of which token belongs to which user, as it's perfectly feasible
that we could have two different users, of different types, with the same token, I've modified my reminder
email to have a type attribute.

To reset your password, complete this form: {{ URL::to('password/reset', array($type, $token)) }}.

This generates a URL like the following.

http://laravel.ollieread.com/password/reset/account/27eb8fe5fe666b3b8d0521156bbf53266dbca572

Which matches the following route.

Route::any('/password/reset/{type}/{token}', 'Controller@method');


## Usage ##

Expand Down Expand Up @@ -113,10 +158,6 @@ And so on and so forth.

There we go, done! Enjoy yourselves.

## Known Bugs ##

Reminders don't currently work.

### License

This package inherits the licensing of its parent framework, Laravel, and as such is open-sourced
Expand Down

0 comments on commit 347bcc1

Please sign in to comment.