amgrade/laravel-heimdall

v2.0.0 2025-09-12 12:47 UTC

This package is auto-updated.

Last update: 2025-09-15 09:28:00 UTC


README

About Laravel Heimdall

Laravel Heimdall is a package that allows you to specify a list of exact emails, email domains, and regular expressions for prohibiting emails.

Installation

composer require amgrade/laravel-heimdall

Configuration

This package supports the discovery configuration of the service provider. If you prefer manual installation, then add to config/app.php in the providers section the next line:

'providers' => [
    AMgrade\Heimdall\ServiceProvider::class,
],

You can optionally publish the config file with:

php artisan vendor:publish --provider="\AMgrade\Heimdall\ServiceProvider"

Then open the config/heimdall.php and configure a list of emails, regular expressions, or domains against which the email will be checked.

Usage

You have two options to use this package: observer or/and a validation rule.

Observer prevents the creating/updating of enumerated models in heimdall.php config file.

If you want to use the validation rule, just add heimdall validation rule to the field which should be validated, for example 'email' => ['heimdall'].

Available options in a heimdall validation rule: full, domain, regexp, and all - a combination of these three rules.

Validation rule usage: heimdall:domain, heimdall:domain,regexp.

If no rule type is added, will be applied all rule type. For example: heimdall, heimdall:.