Package Data | |
---|---|
Maintainer Username: | mikemclin |
Maintainer Contact: | mike@mikemclin.com (Mike McLin) |
Package Create Date: | 2014-01-13 |
Package Last Update: | 2021-09-30 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-19 03:11:28 |
Package Statistics | |
---|---|
Total Downloads: | 2,796,365 |
Monthly Downloads: | 45,380 |
Daily Downloads: | 2,352 |
Total Stars: | 85 |
Total Watchers: | 6 |
Total Forks: | 15 |
Total Open Issues: | 1 |
This Laravel 4/5 package provides an easy way to create and check against WordPress password hashes. WordPress is not required.
Begin by installing this package through Composer. Edit your project's composer.json
file to require mikemclin/laravel-wp-password
.
"require": {
"mikemclin/laravel-wp-password": "~2.0.1"
}
Next, update Composer from the Terminal:
composer update
Once this operation completes, the final step is to add the service provider.
config/app.php
, and add a new item to the providers arrayapp/config/app.php
, and add a new item to the providers array'MikeMcLin\WpPassword\WpPasswordProvider'
Add a use statement for the WpPassword facade
use MikeMcLin\WpPassword\Facades\WpPassword;
make()
- Create Password HashSimilar to the WordPress wp_hash_password()
function
$hashed_password = WpPassword::make('plain-text-password');
check()
- Check Password HashSimilar to the WordPress wp_check_password()
function
$password = 'plain-text-password';
$wp_hashed_password = '$P$B7TRc6vrwCfjgKLZLgmN.dmPo6msZR.';
if ( WpPassword::check($password, $wp_hashed_password) ) {
// Password success!
} else {
// Password failed :(
}
I used a facade above to simplify the documentation. If you'd prefer not to use the facade, you can inject the following interface: MikeMcLin\WpPassword\Contracts\WpPassword
.