You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Laravel package to detect and block disposable (temporary) email addresses during validation or runtime logic.
11
+
Laravel Disposable Email Detection is a Laravel package for detecting and blocking disposable email addresses during validation and runtime checks. It helps protect registrations, lead forms, and application workflows from temporary inbox abuse.
This package receives a **weekly** patch release containing updates to the built-in disposable domains list. If you are not able to bump your installed version accordingly, or just want to stay ahead of things, make sure to update the domains list yourself at any interval you like by running or scheduling the `erag:sync-disposable-email-list` command:
description: Build and work with laravel-disposable-email validation, runtime checks, Blade conditionals, config, sync commands, and custom blacklist workflows. Use when adding or updating disposable email validation in Laravel forms, services, middleware, controllers, Blade views, or scheduled tasks.
3
+
description: Add and maintain laravel-disposable-email validation, runtime checks, sync flows, scheduling, caching, troubleshooting, and Blade conditionals in Laravel applications. Use when working on forms, Form Requests, APIs, services, middleware, jobs, or custom blacklist workflows.
4
4
---
5
5
6
6
# Laravel Disposable Email Detection
7
7
8
-
Use this skill when a task involves this package's validation rule, facade, Blade directive, install command, sync command, or config.
8
+
Use this skill when a task involves the package's validation rule, rule object, facade, Blade conditional, install command, sync command, scheduler setup, config, caching, or blacklist files.
9
9
10
10
## Read First
11
11
12
-
Read `reference.md` in this folder before making changes. It contains the package API, conventions, and implementation examples that match the package README and source.
12
+
Read `reference.md` in this folder before making changes. It mirrors the current package docs and keeps examples aligned with the package API and Laravel usage patterns.
13
13
14
14
## Working Rules
15
15
16
-
- Prefer the built-in validation rule name `disposable_email` for standard request validation.
17
-
- Use `EragLaravelDisposableEmail\Rules\DisposableEmailRule` when an explicit rule object is clearer.
18
-
- Use `EragLaravelDisposableEmail\Support\Email` when the task is about package internals or shared support logic.
19
-
- Use `DisposableEmailRule::isDisposable($email)` or the `DisposableEmail` facade for runtime checks.
20
-
- Use the `@disposableEmail(...)` Blade conditional for view-only branching.
21
-
- Use `php artisan erag:install-disposable-email` to publish config before instructing users to edit `config/disposable-email.php`.
22
-
- Use `php artisan erag:sync-disposable-email-list` when the task is about refreshing remote domain lists.
23
-
- Put custom domains in the configured blacklist directory as plain domains, one per line.
24
-
- If caching is enabled, remember cache invalidation when domain sources change.
16
+
- Prefer the built-in validation rule name `disposable_email` for standard request validation in controllers, Form Requests, APIs, and manual validators.
17
+
- Use `EragLaravelDisposableEmail\Rules\DisposableEmailRule` when an explicit rule object or direct runtime check is clearer.
18
+
- Use the `DisposableEmail` facade when the codebase already favors facade-style package access.
19
+
- Use `@disposableEmail(...)` only for Blade branching, not as a replacement for request validation.
20
+
- Use `php artisan erag:install-disposable-email` before instructing users to edit `config/disposable-email.php`.
21
+
- Use `php artisan erag:sync-disposable-email-list` when the task is about refreshing remote domain lists from configured sources.
22
+
- Treat `config('disposable-email.remote_url')` as the source of truth for sync inputs.
23
+
- Put custom domains in the configured blacklist directory as plain domains, one per line, in `.txt` files.
24
+
- Mention scheduling separately when the user wants automatic syncs. Use Laravel's scheduler with `erag:sync-disposable-email-list`.
25
+
- Mention caching separately when the user wants repeated lookups optimized or config changes reflected.
26
+
- If caching is enabled, include cache clearing as part of troubleshooting and rollout steps.
25
27
26
28
## Implementation Notes
27
29
28
30
- The package registers the string validation rule as `disposable_email`.
29
31
- The Blade conditional name is `disposableEmail`.
30
32
- The config file is `config/disposable-email.php`.
31
33
- The default blacklist directory is `storage/app/blacklist_file`.
32
-
- The package accepts plain domains and also strips `user@domain.tld` entries down to their domain when loading local text files.
34
+
- Remote sync sources are configured through `remote_url`.
35
+
- The package reads every `.txt` file in the configured blacklist directory.
36
+
- The package accepts plain domains and also normalizes `user@domain.tld` style entries down to their domain when loading local text files.
33
37
34
38
## Output Expectations
35
39
36
-
-Show package-native examples first.
37
-
- Keep examples in Laravel style.
40
+
-Start with the simplest Laravel-native example, then move to more advanced usage only if needed.
41
+
- Keep examples in Laravel style and match current docs terminology: Installation, Configuration, Validation and Runtime, Sync and Blacklist, Schedule Sync, Caching, Troubleshooting.
38
42
- When documenting setup, mention the exact Artisan commands exposed by the package.
43
+
- If the task is about a bug or package behavior, include the fastest troubleshooting step first.
0 commit comments