Download the PHP package codebyray/laravel-auth-log without Composer

On this page you can find all versions of the php package codebyray/laravel-auth-log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-auth-log

Laravel Auth Log is a package which tracks your user's authentication information such as login/logout time, IP, Browser, Location, etc. as well as sends out notifications via mail, slack, or sms for new devices and failed logins.

Documentation, Installation, and Usage Instructions

Installation

Installing the package via composer:

If you want to use the location features you will need to install torann/geoip

If you choose to install torann/geop you should publish the config file:

Setup / Configuration

Publish and run the migrations:

Publish views and email files:

Publish the config file:

Config file contents:

Setup The User Model

In order to log the events above you need to add the AuthenticationLoggable and Notifiable traits to your model. The Notifiable is normally setup when you generate a model using the artisan make:model command, if it does not be sure to add it.

This package will listen to Laravel's Login, Logout, Failed and OtherDeviceLogout events.

Usage

Getting The Logs

Get all the authentication logs for a user:

Get the users last login information:

Get a users previous successful login time or IP address:

In the above examples you can use auth()->user() to get the logs for the currently logged in user.

Notifications

Notifications are sent out via email by default. You can sent them to be sent by 'mail', 'nexmo' and 'slack' by setting them in your 'Authenticatable' model. To setup the channels you want notifications sent, you nee to define the 'notifyAuthenticationLogVia' method in your Authenticatable model.

In order to use 'Slack' and/or 'Nexmo', you need to install the drivers for each and follow their documentation for setting up your 'Authenticatable' models.

New Device Notifications

Enabled by default, they use the \Codebyray\LaravelAuthLog\Notifications\NewDevice class which can be overridden in the config file.

Failed Login Notifications

Enabled by default, they use the \Codebyray\LaravelAuthLog\Notifications\FailedLogin class which can be overridden in the config file.

Location

If the torann/geoip package is installed, you will need to enable locations via the config file. This is disabbled by default.

You can turn this on within the configuration for each template.

Note: By default when working locally, no location will be recorded because it will send back the default address from the geoip config file. You can override this behavior in the email templates.

Purging Old Logs

You can purge the logs using the following artisian command:

Any records older than the specified number of days in the config/auth-log.php file via the purge setting will be deleted. Default number of days is 365.

You can schedule the command to run automatically every month, or however often you'd like using the following command:

Version Compatibility

Laravel Auth Log
9.x 1.x

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-auth-log with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/contracts Version ^9.0
spatie/laravel-package-tools Version ^1.4.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package codebyray/laravel-auth-log contains the following files

Loading the files please wait ....