-
-
Notifications
You must be signed in to change notification settings - Fork 3
Usage
IRFA edited this page Jul 23, 2020
·
1 revision
Unlock account with Console artisan
php artisan lockout:unlock username
Unlock account programmatically
use Lockout;
use Request;
class UserManage {
public function account_unlock(Request $request){
Lockout::unlock($request->email);
return redirect()->back();
}
}
Lock account with Console artisan
php artisan lockout:lock username
Lock Account programmatically
use Lockout;
use Request;
class UserManage {
public function account_unlock(Request $request){
Lockout::lock($request->email);
return redirect()->back();
}
}
use Lockout;
use Request;
class UserManage {
public function account_unlock(Request $request){
$check = Lockout::isLocked($request->email);//return boolean
if($check){
return "Locked";
} else{
return "Unlocked";
}
}
}
View login attemps with Console artisan
php artisan lockout:check username
Check Login attemps programmatically
use Lockout;
use Request;
class UserManage {
public function account_unlock(Request $request){
$lockout = Lockout::check($request->email);
foreach($lockout as $data){
echo $data->username."\n";
echo $data->attemps."\n";
echo $data->ip."\n";
echo $data->last_attemps."\n";
}
}
}
php artisan lockout:clear
Clear all programmatically
use Lockout;
use Request;
class UserManage {
public function account_unlock(Request $request){
Lockout::clearAll();
}
}
Other Commands
php artisan lockout:info //Show more info this package
php artisan lockout:diagnose //diagnose and testing lockout account
You can change message in `resources/lang/{language}/lockoutMessage.php`
Lockout::message()
-
Run this command
( if your application runs in production it is recomended to run
php artisan down
before running this command)
composer remove irfa/lockout
- Remove service provider for this package in config/app.php
'providers' => [
....
Irfa\Lockout\LockoutAccountServiceProvider::class,
];
- Remove aliases for this package in config/app.php
'aliases' => [
....
'Lockout' => Irfa\Lockout\Facades\Lockout::class,
],
-
Remove file config/irfa/lockout.php
( if your application runs in production it is recomended to run
php artisan up
after running this command)