{"id":13815886,"url":"https://github.com/beyondcode/laravel-confirm-email","last_synced_at":"2025-05-15T17:02:52.155Z","repository":{"id":51343586,"uuid":"131583348","full_name":"beyondcode/laravel-confirm-email","owner":"beyondcode","description":"Add email verification to your Laravel projects","archived":false,"fork":false,"pushed_at":"2024-04-05T14:06:59.000Z","size":50,"stargazers_count":548,"open_issues_count":1,"forks_count":55,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-31T20:11:31.337Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/beyondcode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-30T10:35:06.000Z","updated_at":"2025-03-25T19:45:26.000Z","dependencies_parsed_at":"2024-04-05T14:53:29.721Z","dependency_job_id":"2a56f199-97a2-4f71-a4fd-7490ee15b4e0","html_url":"https://github.com/beyondcode/laravel-confirm-email","commit_stats":{"total_commits":30,"total_committers":11,"mean_commits":2.727272727272727,"dds":0.6333333333333333,"last_synced_commit":"63c79d68507ecd58cee679ddfdc5c54308e57bec"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondcode%2Flaravel-confirm-email","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondcode%2Flaravel-confirm-email/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondcode%2Flaravel-confirm-email/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondcode%2Flaravel-confirm-email/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beyondcode","download_url":"https://codeload.github.com/beyondcode/laravel-confirm-email/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247194635,"owners_count":20899530,"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-08-04T05:00:17.839Z","updated_at":"2025-04-07T21:15:54.516Z","avatar_url":"https://github.com/beyondcode.png","language":"PHP","funding_links":[],"categories":["PHP","Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# Laravel Email Confirmation\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/beyondcode/laravel-confirm-email.svg?style=flat-square)](https://packagist.org/packages/beyondcode/laravel-confirm-email)\n[![Total Downloads](https://img.shields.io/packagist/dt/beyondcode/laravel-confirm-email.svg?style=flat-square)](https://packagist.org/packages/beyondcode/laravel-confirm-email)\n\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require beyondcode/laravel-confirm-email\n```\n\n## Usage\n\nThis package adds a `confirmed_at` and `confirmation_code` field to your users table.\nPublish the migration and the configuration file using\n\n```bash\nphp artisan vendor:publish --provider=\"BeyondCode\\EmailConfirmation\\EmailConfirmationServiceProvider\"\n```\n\nAnd run the migrations:\n\n```bash\nphp artisan migrate\n```\n\n### Configuring the login, register and forgot password controllers\nIn order to make use of the email verification, replace the `AuthenticatesUsers`, `RegistersUsers` and the `SendsPasswordResetEmails` traits that\ncome with Laravel, with the ones provided by this package.\n\nThese traits can be found in these three files:\n\n- `App\\Http\\Controllers\\Auth\\LoginController`\n- `App\\Http\\Controllers\\Auth\\RegisterController`\n- `App\\Http\\Controllers\\Auth\\ForgotPasswordController`\n\n### Add the confirmation and resend routes\n\nAdd the following two routes to your `routes/web.php` file:\n\n```php\nRoute::name('auth.resend_confirmation')-\u003eget('/register/confirm/resend', 'Auth\\RegisterController@resendConfirmation');\nRoute::name('auth.confirm')-\u003eget('/register/confirm/{confirmation_code}', 'Auth\\RegisterController@confirm');\n```\n\n### Show confirmation messages\n\nThis packages adds some flash messages that contain error/information messages for your users.\nTo show them to your users, add this to your `login.blade.php`:\n\n```blade\n@if (session('confirmation'))\n    \u003cdiv class=\"alert alert-info\" role=\"alert\"\u003e\n        {!! session('confirmation') !!}\n    \u003c/div\u003e\n@endif\n```\nand this to both your `login.blade.php` and `email.blade.php`\n```blade\n@if ($errors-\u003ehas('confirmation') \u003e 0 )\n    \u003cdiv class=\"alert alert-danger\" role=\"alert\"\u003e\n        {!! $errors-\u003efirst('confirmation') !!}\n    \u003c/div\u003e\n@endif\n```\n\n### Customization\nThis package comes with a language file, that allows you to modify the error / confirmation messages that your user\nmight see. In addition to that, you can change the notification class that will be used to send the confirmation code\ncompletely, by changing it in the `config/confirmation.php` file.\n\n### Change redirect routes\nYou can change all possible redirect routes by including these values either as properties in your registration controller, or as methods returning the route/URL string:\n\n- `redirectConfirmationTo`\n- `redirectAfterRegistrationTo`\n- `redirectAfterResendConfirmationTo`\n\nThey all default to `route('login')`.\n\n### The Confirmed Event\nOn successful email confirmation, this package dispatches a `Confirmed` event, in order for you to conveniently handle\nany custom logic, such as sending a welcome email or automatically logging the user in.\n\nSimply add the `Confirmed` event, and your listeners, to the `EventServiceProvider` in your application:\n\n```php\n    /**\n     * The event listener mappings for the application.\n     *\n     * @var array\n     */\n    protected $listen = [\n        'BeyondCode\\EmailConfirmation\\Events\\Confirmed' =\u003e [\n            'App\\Listeners\\YourOnConfirmedListener'\n        ]\n    ];\n```\n\nFor more information about registering events and listeners, please refer to the [Laravel docs](https://laravel.com/docs/events#registering-events-and-listeners).\n\n## Catch, test and debug application mails with Laravel Herd\n\nLaravel Herd provides an integrated local email service, streamlining the process of testing and debugging application emails.\nThe email service organizes emails into distinct inboxes for each application, ensuring they are easily accessible and simple to locate.\n\n[herd.laravel.com](https://herd.laravel.com)\n\n![image](https://github.com/user-attachments/assets/6417907c-119d-43ac-9cf6-5638bafae24f)\n\n### Testing\n\n``` bash\ncomposer test\n```\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email marcel@beyondco.de instead of using the issue tracker.\n\n## Credits\n\n- [Marcel Pociot](https://github.com/mpociot)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeyondcode%2Flaravel-confirm-email","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeyondcode%2Flaravel-confirm-email","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeyondcode%2Flaravel-confirm-email/lists"}