Download the PHP package biscolab/laravel-authlog without Composer

On this page you can find all versions of the php package biscolab/laravel-authlog. 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-authlog

Laravel Auth-log

User authentication log for Laravel 5, 6 and 7. This package allows you to log user's authentication and force its logout if necessary!

This package is still unstable. Please report any bug`and documentation lack in order to fix that promptly.

Thanks for your help.

System requirements

Set session.driver value

To use this package the only allowed values of session.driver are file, database, redis (at the moment).

Install

You can install the package via composer:

Laravel 5.5 (or greater) uses package auto-discovery, so doesn't require you to manually add the Service Provider, but if you don't use auto-discovery AuthLogServiceProvider must be registered in config/app.php:

You can use the facade for shorter code. Add AuthLog to your aliases:

Publish package

Publish configuration and migration files using the following artisan command:

Configuration

Edit config/authlog.php

Variable name Type Description Default value
safe_mode bool Avoid to force logout by yourself true
enabled bool If true the package is active and user's authentication will be logged true
skip_ip string A whitelist of IP addresses (CSV format) that, if recognized, disable the package ''
table_name string The name of the AuthLog database table authlog
users_table_size string Users table size in order to add foreign keys (int means INT, big means BIGINT). Since Laravel 5.8, value should be big (*) big
authlog_model string AuthLog class. You can change ìt BUT your custom class MUST implements 'Biscolab\LaravelAuthLog\Models\AuthLogInterface' 'Biscolab\LaravelAuthLog\Models\AuthLog'
session_model string Session class. You can change ìt BUT your custom class MUST implements 'Biscolab\LaravelAuthLog\Models\SessionInterface' 'Biscolab\LaravelAuthLog\Models\Session'
session_auth_log_id_key string Session key used to store your AuthLog ID 'auth_log_id'
add_auth_log_id_to_ajax_response bool If true AuthLog ID will be added to your AJAX responses true
ajax_response_auth_log_id_name string AJAX response key used to send your AuthLog ID 'auth_log_id'
add_auth_log_id_header_to_http_response bool If true AuthLog ID will be added to your response headers true
auth_log_id_header_nameauth_log_id_header_name string AuthLog ID header name 'X-Auth-Log-Id'

Remember to run the php artisan config:cache command

(*) If you are using a custom users table please edit datatbase/migratons/2019_09_19_000000_create_authlog_table.php after run vendor:publish artisan command and before run migration artisan command

Add AuthLoggable trait to User model

Use Biscolab\LaravelAuthLog\Traits\AuthLoggable in App\User

Database

Your users' table id MUST be either of type unsignedInteger or unsignedBigInteger. If you have a custom users' table edit datatbase/migratons/2019_09_19_000000_create_authlog_table.php after vendor:publish artisan command

Run migrations

AuthLog database table will be created.

Middleware

Register `AuthLogMiddleware

Register AuthLogMiddleware in app/Http/Kernel.php. This middleware will handle user authentication session ID.

`

Add AuthLogMiddleware to routes

Handle logged users

Artisan Command

To handle auth sessions type the following artisan command

The list of logged users will be shown

Now you can either quit typing exit or force user logout typing the specific Log ID, in this case 604.


All versions of laravel-authlog with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
laravel/framework Version ^5.5|^6.0|^7.0
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 biscolab/laravel-authlog contains the following files

Loading the files please wait ....