{"id":21866234,"url":"https://github.com/alaminfirdows/laravel-multi-auth","last_synced_at":"2025-04-14T21:21:22.072Z","repository":{"id":56943578,"uuid":"217026380","full_name":"alaminfirdows/laravel-multi-auth","owner":"alaminfirdows","description":"Multi Auth package for Laravel project.","archived":false,"fork":false,"pushed_at":"2019-10-23T15:49:39.000Z","size":34,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T09:36:12.522Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/alaminfirdows/laravel-multi-auth","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alaminfirdows.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-23T10:05:13.000Z","updated_at":"2023-03-30T05:51:41.000Z","dependencies_parsed_at":"2022-08-21T07:50:50.030Z","dependency_job_id":null,"html_url":"https://github.com/alaminfirdows/laravel-multi-auth","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alaminfirdows%2Flaravel-multi-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alaminfirdows%2Flaravel-multi-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alaminfirdows%2Flaravel-multi-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alaminfirdows%2Flaravel-multi-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alaminfirdows","download_url":"https://codeload.github.com/alaminfirdows/laravel-multi-auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248606859,"owners_count":21132428,"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":[],"created_at":"2024-11-28T04:24:45.017Z","updated_at":"2025-04-14T21:21:22.048Z","avatar_url":"https://github.com/alaminfirdows.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi Auth for Laravel 6.\\*\n\n-   `php artisan laravel-multi-auth:install {guard} -f`\n-   `php artisan laravel-multi-auth:install {guard} -f --domain`\n-   `php artisan laravel-multi-auth:install {guard} {service} -f --lucid`\n\n## What it does?\n\nThis a simple package to create the multi authentication feature on your Laravel 6.\\* project. By running some simple command you can setup multi auth for your Laravel project. The package installs:\n\n-   Model\n-   Migration\n-   Controllers\n-   Notification\n-   Routes\n    -   routes/web.php\n        -   {guard}/login\n        -   {guard}/register\n        -   {guard}/logout\n        -   Password Reset Routes\n            -   {guard}/password/reset\n            -   {guard}/password/email\n    -   routes/{guard}.php\n        -   {guard}/home\n-   Middleware\n-   Views\n-   Guard\n-   Provider\n-   Password Broker\n-   Settings\n\n## Usage\n\n### Step 1: Install Through Composer\n\n```\ncomposer require alaminfirdows/laravel-multi-auth\n```\n\n### Step 2: Install Multi Auth in Your Project\n\n```\nphp artisan laravel-multi-auth:install {singular_lowercase_name_of_guard} -f\n\n// Examples\nphp artisan laravel-multi-auth:install admin -f\nphp artisan laravel-multi-auth:install employee -f\nphp artisan laravel-multi-auth:install customer -f\n```\n\nNotice:\nIf you don't provide `-f` flag, it will not work. It is a protection against accidental activation.\n\nAlternative:\n\nIf you want to install Multi-Auth files in a subdomain you must pass the option `--domain`.\n\n```\nphp artisan laravel-multi-auth:install admin -f --domain\nphp artisan laravel-multi-auth:install employee -f --domain\nphp artisan laravel-multi-auth:install customer -f --domain\n```\n\nTo be able to use this feature properly, you should add a key to your .env file:\n\n```\nAPP_DOMAIN=yourdomain.com\n```\n\nThis will allow us to use it in the routes file, prefixing it with the domain feature from Laravel routing system.\n\nUsing it like so: `['domain' =\u003e '{guard}.' . env('APP_DOMAIN')]`\n\n### Step 3: Migrate new model table\n\n```\nphp artisan migrate\n```\n\n### Step 4: Try it\n\nGo to: `http://project_url/GuardName/login`\n\nExample: `http://myproject.dev/customer/login`\n\n## Options\n\nIf you don't want model and migration use `--model` flag.\n\n```\nphp artisan laravel-multi-auth:install admin -f --model\n```\n\nIf you don't want views use `--views` flag.\n\n```\nphp artisan laravel-multi-auth:install admin -f --views\n```\n\nIf you don't want routes in your `routes/web.php` file, use `--routes` flag.\n\n```\nphp artisan laravel-multi-auth:install admin -f --routes\n```\n\n## Note\n\nIf you want to change the redirect path for once your `guard` is logged out. Add and override the following method in\nyour {GuardName}\\Auth\\LoginController:\n\n```php\n/**\n * Get the path that we should redirect once logged out.\n * Adaptable to user needs.\n *\n * @return string\n */\npublic function logoutToPath() {\n    return '/';\n}\n```\n\n## Files which are changed and added by this package\n\n-   config/auth.php\n\n    -   Add guards, providers, passwords\n\n-   app/Http/Providers/RouteServiceProvider.php\n\n    -   Register routes\n\n-   app/Http/Kernel.php\n\n    -   Register middleware\n\n-   app/Http/Middleware/\n\n    -   Middleware for each guard\n\n-   app/Http/Controllers/{Guard}/Auth/\n\n    -   New controllers\n\n-   app/Models/{Guard}.php\n\n    -   New Model\n\n-   app/Notifications/{Guard}/ResetPassword.php\n\n    -   Reset password notification\n\n-   database/migrations/\n\n    -   Migration for new model\n\n-   routes/web.php\n\n    -   Register routes\n\n-   routes/{guard}.php\n\n    -   Routes file for given guard\n\n-   resources/views/{guard}/\n    -   Views for given guard\n\n## Changelog\n\n### Note: Never install configurations with same guard again after installed new version of package. So if you already installed your `admin` guard, don't install it again after you update package to latest version.\n\n### v0.0.1-alpha\n\n-   Updated all deprecated string helpers to Laravel 6.0\n-   Reform Controllers Path and namespace\n-   Reform Models Path and namespace\n\n## Special thanks to [Piotr Łosiak (Hesto)](https://github.com/hesto/)\n\nI inspired to create this package from [hesto/multi-auth](https://packagist.org/packages/hesto/multi-auth).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falaminfirdows%2Flaravel-multi-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falaminfirdows%2Flaravel-multi-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falaminfirdows%2Flaravel-multi-auth/lists"}