{"id":19198728,"url":"https://github.com/laravolt/auth","last_synced_at":"2025-07-31T06:33:29.940Z","repository":{"id":57012301,"uuid":"43279685","full_name":"laravolt/auth","owner":"laravolt","description":"Laravel auth extended","archived":false,"fork":false,"pushed_at":"2020-10-28T05:10:41.000Z","size":153,"stargazers_count":14,"open_issues_count":5,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-11T09:52:48.638Z","etag":null,"topics":["authentication","laravel","laravolt","package"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/laravolt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-28T04:23:33.000Z","updated_at":"2024-07-24T05:52:13.000Z","dependencies_parsed_at":"2022-08-21T15:10:46.430Z","dependency_job_id":null,"html_url":"https://github.com/laravolt/auth","commit_stats":null,"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"purl":"pkg:github/laravolt/auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laravolt%2Fauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laravolt%2Fauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laravolt%2Fauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laravolt%2Fauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laravolt","download_url":"https://codeload.github.com/laravolt/auth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laravolt%2Fauth/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264972154,"owners_count":23691376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","laravel","laravolt","package"],"created_at":"2024-11-09T12:23:25.101Z","updated_at":"2025-07-31T06:33:29.888Z","avatar_url":"https://github.com/laravolt.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# laravolt/auth\n\n![https://travis-ci.org/laravolt/auth](https://img.shields.io/travis/laravolt/auth.svg)\n![https://coveralls.io/github/laravolt/auth](https://img.shields.io/coveralls/laravolt/auth.svg)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/64a4da48-4cab-418e-9594-cb90d7f3e792/mini.png)](https://insight.sensiolabs.com/projects/64a4da48-4cab-418e-9594-cb90d7f3e792)\n\nLaravel authentication with some additional features:\n\n* Activation\n* Enable/disable registration\n* Captcha\n* Custom email template\n* Functionally tested\n\n\n## Installation\n\n* Run `composer require laravolt/auth`\n* For Laravel 5.4 or below, add `Laravolt\\Auth\\ServiceProvider::class` as service providers\n* Optionally, you can run `php artisan vendor:publish --provider=\"Laravolt\\Auth\\ServiceProvider\" --tag=\"migrations\"` to publish migrations files for further editing\n\n\n## Configuration\n\n```php\n\u003c?php\nreturn [\n    // Base layout to extend by every view\n    'layout'       =\u003e 'ui::layouts.auth',\n\n    // Enable captcha (Google reCaptcha) on login form\n    'captcha'      =\u003e false,\n\n    // Column name to be checked for authentication (login)\n    'identifier'   =\u003e 'email',\n\n    // Configuration related to login process\n    'login' =\u003e [\n        'implementation' =\u003e \\Laravolt\\Auth\\DefaultLogin::class,\n    ],\n\n    // Configuration related to registration process\n    'registration' =\u003e [\n\n        // Enable or disable registration form\n        'enable'         =\u003e true,\n\n        // Default status for newly registered user\n        'status'         =\u003e 'ACTIVE',\n\n        // During the process, data from registration form will be passed to this class.\n        // You may create your own implementation by creating UserRegistrar class.\n        'implementation' =\u003e \\Laravolt\\Auth\\DefaultUserRegistrar::class,\n    ],\n\n    // Configuration related to registration process\n    'activation'   =\u003e [\n        // If enabled, newly registered user are not allowed to login until they click\n        // activation link that sent to their email.\n        'enable'        =\u003e false,\n\n        // Status for newly registered user, before activation\n        'status_before' =\u003e 'PENDING',\n\n        // Status for newly registered user, after successfully activate their account\n        'status_after'  =\u003e 'ACTIVE',\n    ],\n\n    // Routes configuration\n    'router'       =\u003e [\n        'middleware' =\u003e ['web'],\n        'prefix'     =\u003e 'auth',\n    ],\n\n    // Redirect configuration\n    'redirect'     =\u003e [\n        // Where to redirect after successfully login\n        'after_login'          =\u003e '/',\n\n        // Where to redirect after successfully register\n        'after_register'       =\u003e '/',\n\n        // Where to redirect after successfully reset password\n        'after_reset_password' =\u003e '/',\n    ],\n\n    // Whether to auto load migrations or not.\n    // If set to false, then you must publish the migration files first before running the migrate command\n    'migrations' =\u003e false,\n];\n```\n\n## Captcha\nIf you enable captcha (by setting `'captcha' =\u003e true` in config file), please add following entries to `.env`:\n```\nNOCAPTCHA_SECRET=YOUR_RECAPTCHA_SECRET\nNOCAPTCHA_SITEKEY=YOUR_RECAPTCHA_SITEKEY\n```\nYou can obtain them from www.google.com/recaptcha/admin.\n\n## Custom Login Form\n\n### Modify Form (View File)\nRun `php artisan vendor:publish --provider=\"Laravolt\\Auth\\ServiceProvider\"`.\nYou can modify the view located in `resources/views/vendor/auth/login.blade.php`.\n\n### Modify Logic\nCreate new class to handle user login that implements `Laravolt\\Auth\\Contracts\\Login` contract.\nYou must implement two method related to registration:\n1. `rules(Request $request)` to get validation rules.\n2. `credentials(Request $request)` to check valid credentials.\noptionally:\n1. `authenticated(Request $request, $user)` to handle after login, it should be returned `\\Illuminate\\Http\\Response` or `null`\n1. `failed(Request $request)` to handle custom failed response\n\n## Custom Registration Form\nSometimes you need to modify registration form, e.g. add more fields, change logic, or add some validation.\nThere are several way you can accomplish those.\n\n### Modify Form (View File)\nRun `php artisan vendor:publish --provider=\"Laravolt\\Auth\\ServiceProvider\"`.\nYou can modify the view located in `resources/views/vendor/auth/register.blade.php`.\n\n### Modify Logic\nCreate new class to handle user registration that implements `Laravolt\\Auth\\Contracts\\UserRegistrar` contract.\nYou must implement two method related to registration:\n1. `validate($data)` to handle validation logic.\n2. `register($data)` to handle user creation logic.\noptionally:\n1. `registered(Request $request, $user)` to handle after registration is completed, it should be returned `\\Illuminate\\Http\\Response` or `null`\n\n```php\n\u003c?php\nnamespace App\\Registration;\n\nuse Illuminate\\Support\\Facades\\Validator;\nuse Laravolt\\Auth\\Contracts\\UserRegistrar;\n\nclass CustomUserRegistrar implements UserRegistrar\n{\n    /**\n     * Validate data.\n     *\n     * @param array $data\n     */\n    public function validate(array $data)\n    {\n        // Modify default behaviour, or completely change it\n        return Validator::make(\n            $data,\n            [\n                'name'     =\u003e 'required|max:255',\n                'email'    =\u003e 'required|email|max:255|unique:users',\n                'password' =\u003e 'required|min:6',\n            ]\n        );\n    }\n\n    /**\n     * Create model.\n     *\n     * @param $\n     *\n     */\n    public function register(array $data)\n    {\n        // create Authenticatable model.\n        $user = User::create($data);\n\n        // return Authenticatable model.\n        return $user;\n    }\n}\n\n```\n\n#### Modify Activation Logic\n\nadd `Laravolt\\Auth\\Contracts\\ShouldActivate` implementation to your `registration.implementation` class by add these function to your registrar class.\n1. `notify(Model $user, $token)`\n2. `activate($token)`\n```php\n...\nclass CustomUserRegistrar implements UserRegistrar, ShouldActivate\n{\n    ...\n\n    /**\n     * Notify if user to activate the user with the token provided.\n     *\n     * @param \\Illuminate\\Database\\Eloquent\\Model|Authenticatable $user\n     * @param string $token\n     * @return void\n     */\n    public function notify(Model $user, $token)\n    {\n        //\n    }\n\n    /**\n     * Activation method by the token provided.\n     *\n     * @param string $token\n     * @return \\Illuminate\\Http\\Response\n     */\n    public function activate($token)\n    {\n        $token = \\DB::table('users_activation')-\u003ewhereToken($token)-\u003efirst();\n\n        if (! $token) {\n            abort(404);\n        }\n\n        \\User::where('id', $token-\u003euser_id)-\u003eupdate(['status' =\u003e config('laravolt.auth.activation.status_after')]);\n        \\DB::table('users_activation')-\u003ewhere('user_id', $token-\u003euser_id)-\u003edelete();\n\n        return redirect()-\u003eroute('auth::login')-\u003ewithSuccess(trans('auth::auth.activation_success'));\n    }\n}\n```\n\nAfter that, you must update auth config (located in `config/laravolt/auth.php`, if not, just run `php artisan vendor:publish`).\n\n```php\n...\n    'registration' =\u003e [\n        // During the process, data from registration form will be passed to this class.\n        // You may create your own implementation by creating UserRegistrar class.\n        'implementation' =\u003e \\App\\Registration\\CustomUserRegistrar::class,\n    ],\n\n...\n```\n\n## LDAP\n\n### Environment Variables\n```\nLDAP_HOSTS=ldap.forumsys.com\nLDAP_BASE_DN='dc=example,dc=com'\nLDAP_PORT=389\nLDAP_USERNAME='cn=read-only-admin,dc=example,dc=com'\nLDAP_PASSWORD='password'\nLDAP_USE_SSL=false\nLDAP_USE_TLS=false\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaravolt%2Fauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaravolt%2Fauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaravolt%2Fauth/lists"}