Add an enabler resolver config

Author: systemsolutionwebCreated Apr 30, 2025Updated Aug 18, 2026

What if a resolver is created, which can be declared within the configuration file, where extra validation can be added by returning a boolean,

for example: within the resolver validate if a user is an administrator and based on that enable the debugbar, it would not appear to any other user

Is there already such an option? Would it be a good idea to implement it to add more control?

php
class DebugbarEnableResolver implements Resolver
{
    public static function resolve(): bool
    {
        if (Auth::check() && Auth::user()->is_admin) {
            return true
        }
        
        // here maybe other conditions

        return false;
    }
}

Source: fruitcake/laravel-debugbar