Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Elements/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ public static function registerElementMutator(callable $mutator): void
self::$element_mutators[static::class][] = $mutator;
}

/**
* Reset element mutators
*
* Resets all element mutators. Useful for testing.
*/
public static function resetElementMutators(): void
{
self::$element_mutators = [];
}

/**
* Set a data attribute
*
Expand Down
2 changes: 2 additions & 0 deletions src/Support/AireServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Galahad\Aire\Aire;
use Galahad\Aire\Elements\ClientValidation;
use Galahad\Aire\Elements\Element;
use Galahad\Aire\Elements\Form;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Support\Facades\Blade;
Expand Down Expand Up @@ -67,6 +68,7 @@ public function boot()

$this->app->terminating(function() {
ClientValidation::reset();
Element::resetElementMutators();
});
}

Expand Down
Loading