mawuekom/laravel-passauth

A Bunch of authentication features for laravel

v2.3.0 2022-04-25 00:23 UTC

README

This package provide a bunch of authentication features.

Installation

You can install the package via composer:

composer require mawuekom/laravel-passauth

Usage

Once install, go to config/app.php to add PassauthServiceProvider in providers array

Laravel 5.5 and up Uses package auto discovery feature, no need to edit the config/app.php file.

  • Service Provider

'providers' => [

    ...

    Mawuekom\Passauth\PassauthServiceProvider::class,

],
  • Publish Assets

php artisan vendor:publish --provider="Mawuekom\Passauth\PassauthServiceProvider"

Or you can publish config

php artisan vendor:publish --provider="Mawuekom\Passauth\PassauthServiceProvider" --tag="config"

Configuration

  • You can change connection for models, models path and there is also a handy pretend feature.
  • There are many configurable options which have been extended to be able to configured via .env file variables.
  • Editing the configuration file directly may not needed because of this.
  • See config file: passauth.php.
<?php

/*
 * You can place your custom package configuration in here.
 */
return [
    /*
    |--------------------------------------------------------------------------
    | Users feature settings
    |--------------------------------------------------------------------------
    */

    'user' => [
        'model'             => App\Models\User::class,
        'name'              => 'User',
        'resource_name'     => 'user',

        'table'     => [
            'name'          => env('PASSAUTH_USERS_DATABASE_TABLE', 'users'),
            'primary_key'   => env('PASSAUTH_USERS_DATABASE_TABLE_PRIMARY_KEY', 'id'),
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Password history config
    |--------------------------------------------------------------------------
    */
    'password_history' => [
        'enable'            => true,
        'checker'           => false,
        'number_to_check'   => 3,
    ],

    /*
    |--------------------------------------------------------------------------
    | Required identifiants
    |--------------------------------------------------------------------------
    */

    'required_identifiants' => [
        'email'                 => true,
        'phone_number'          => false,
    ],

    /*
    |--------------------------------------------------------------------------
    | Bunch of features to enable or disable.
    |--------------------------------------------------------------------------
    */

    'enable' => [
        'email_verification' => false,
        'proper_names' => false,
        'agree_with_policy_and_terms_data' => true,
        'last_login_data' => true,
    ],

    'agree_with_policy_and_terms_column' => [
        'name' => 'has_agreed_with_policy_and_terms_at',
        'type' => 'timestamp'
    ],

    'last_login_column' => [
        'name' => 'last_login_at',
        'type' => 'timestamp'
    ],
];

The rest is comming soon

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

License

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