在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):yadahan/laravel-authentication-log开源软件地址(OpenSource Url):https://github.com/yadahan/laravel-authentication-log开源编程语言(OpenSource Language):PHP 96.9%开源软件介绍(OpenSource Introduction):Laravel Authentication LogInstallation
You may use Composer to install Laravel Authentication Log into your Laravel project:
ConfigurationAfter installing the Laravel Authentication Log, publish its config, migration and view, using the
Next, you need to migrate your database. The Laravel Authentication Log migration will create the table your application needs to store authentication logs:
Finally, add the use Illuminate\Notifications\Notifiable;
use Yadahan\AuthenticationLog\AuthenticationLogable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable, AuthenticationLogable;
} Basic UsageGet all authentication logs for the user: User::find(1)->authentications; Get the user last login info: User::find(1)->lastLoginAt();
User::find(1)->lastLoginIp(); Get the user previous login time & ip address (ignoring the current login): auth()->user()->previousLoginAt();
auth()->user()->previousLoginIp(); Notify login from a new deviceNotifications may be sent on the You may define /**
* The Authentication Log notifications delivery channels.
*
* @return array
*/
public function notifyAuthenticationLogVia()
{
return ['nexmo', 'mail', 'slack'];
} Of course you can disable notification by set the 'notify' => env('AUTHENTICATION_LOG_NOTIFY', false), Clear old logsYou may clear the old authentication log records using the
Records that is older than the number of days specified in the 'older' => 365, ContributingThank you for considering contributing to the Laravel Authentication Log. LicenseLaravel Authentication Log is open-sourced software licensed under the MIT license. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论