Skip to content

Conversation

@gisostallenberg
Copy link
Contributor

No description provided.

*/
public static function bootAuditable()
{
if (App::getFacadeRoot() && static::isAuditingEnabled()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erikn69 I can't remember why the App::getFacadeRoot() check is required but I definitely remember needing it at some point, does that ring any bells for you?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but that will in some cases make audits not happen at all (because when the app is not spun up, but the model gets booted, it will never observe)

The tests succeed, even OutsideOfAppContextTest

Copy link
Contributor

@erikn69 erikn69 Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something is being reversed; I believe it was perhaps for performance reasons, to avoid always registering observers, I don't remember.

It seems it's always been like this: #134

return;
}
$modelClass = $model::class;
if (method_exists($modelClass, 'isAuditingEnabled') && ! $modelClass::isAuditingEnabled()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like one check has been replaced by two, is this one definitely needed? should there be a separate test to pick it up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants